in usecases/mwaa-with-codeartifact/infra/vpc_stack.py [0:0]
def create_endpoints(self) -> None:
endpoints = {
"SQS": ec2.InterfaceVpcEndpointAwsService.SQS,
"CLOUDWATCH_LOGS": ec2.InterfaceVpcEndpointAwsService.CLOUDWATCH_LOGS,
"CLOUDWATCH_MONITORING": ec2.InterfaceVpcEndpointAwsService.CLOUDWATCH,
"KMS ": ec2.InterfaceVpcEndpointAwsService.KMS,
"ECR": ec2.InterfaceVpcEndpointAwsService.ECR,
"ECR_DOCKER": ec2.InterfaceVpcEndpointAwsService.ECR_DOCKER,
"CODE_ARTIFACT_API": ec2.InterfaceVpcEndpointAwsService(
name="codeartifact.api"
),
"CODE_ARTIFACT_REPOSITORIES": ec2.InterfaceVpcEndpointAwsService(
name="codeartifact.repositories"
),
}
for name, service in endpoints.items():
ec2.InterfaceVpcEndpoint(
self,
name,
vpc=self.instance,
service=service,
subnets=ec2.SubnetSelection(subnet_type=ec2.SubnetType.ISOLATED),
private_dns_enabled=True,
security_groups=[self.mwaa_sg],
)
self.instance.add_gateway_endpoint(
"s3-endpoint",
service=ec2.GatewayVpcEndpointAwsService.S3,
subnets=[ec2.SubnetSelection(subnet_type=ec2.SubnetType.ISOLATED)],
)