Esempio n. 1
0
 def __init__(self, region, vpc_id=None):
     super(AwsVpc, self).__init__(vpc_id is not None)
     self.region = region
     self.id = vpc_id
     # Subnets are assigned per-AZ.
     # _subnet_index tracks the next unused 10.0.x.0/24 block.
     self._subnet_index = 0
     # Lock protecting _subnet_index
     self._subnet_index_lock = threading.Lock()
     self.default_security_group_id = None
     if self.id:
         self._SetSecurityGroupId()
     self._endpoints = [
         aws_vpc_endpoint.CreateEndpointService(service, self)
         for service in set(FLAGS.aws_endpoint)
     ]
 def _InitEndpoint(self, vpc_id):
   self.mock_vpc.id = vpc_id
   return aws_vpc_endpoint.CreateEndpointService(SERVICE_NAME, self.mock_vpc)