in network/swift_vpc_endpoints.py [0:0]
def create_interface_endpoint(self, service_name: str, security_group: _ec2.ISecurityGroup,
vpc: _ec2.Vpc,
interface_endpoint_policy: _iam.PolicyStatement = None):
"""create interface endpoint"""
vpc_endpoint = _ec2.InterfaceVpcEndpoint(
self, id=service_name.upper() + "VPCEndPoint",
vpc=vpc,
service=_ec2.InterfaceVpcEndpointAwsService(service_name),
private_dns_enabled=True,
security_groups=[security_group]
)
if interface_endpoint_policy is not None:
vpc_endpoint.add_to_policy(interface_endpoint_policy)