GatewayVpcEndpointAwsService

class aws_cdk.aws_ec2.GatewayVpcEndpointAwsService(name, prefix=None)

Bases: object

An AWS service for a gateway VPC endpoint.

ExampleMetadata:

lit=aws-ec2/test/integ.vpc-endpoint.lit.ts infused

Example:

# Add gateway endpoints when creating the VPC
vpc = ec2.Vpc(self, "MyVpc",
    gateway_endpoints={
        "S3": cdk.aws_ec2.GatewayVpcEndpointOptions(
            service=ec2.GatewayVpcEndpointAwsService.S3
        )
    }
)

# Alternatively gateway endpoints can be added on the VPC
dynamo_db_endpoint = vpc.add_gateway_endpoint("DynamoDbEndpoint",
    service=ec2.GatewayVpcEndpointAwsService.DYNAMODB
)

# This allows to customize the endpoint policy
dynamo_db_endpoint.add_to_policy(
    iam.PolicyStatement( # Restrict to listing and describing tables
        principals=[iam.AnyPrincipal()],
        actions=["dynamodb:DescribeTable", "dynamodb:ListTables"],
        resources=["*"]))

# Add an interface endpoint
vpc.add_interface_endpoint("EcrDockerEndpoint",
    service=ec2.InterfaceVpcEndpointAwsService.ECR_DOCKER
)
Parameters:
  • name (str) – The name of the service.

  • prefix (Optional[str]) –

Attributes

DYNAMODB = <aws_cdk.aws_ec2.GatewayVpcEndpointAwsService object>
S3 = <aws_cdk.aws_ec2.GatewayVpcEndpointAwsService object>
S3_EXPRESS = <aws_cdk.aws_ec2.GatewayVpcEndpointAwsService object>
name

The name of the service.