GatewayVpcEndpointOptions

class aws_cdk.aws_ec2.GatewayVpcEndpointOptions(*, service, dns_record_ip_type=None, ip_address_type=None, subnets=None)

Bases: object

Options to add a gateway endpoint to a VPC.

Parameters:
  • service (IGatewayVpcEndpointService) – The service to use for this gateway VPC endpoint.

  • dns_record_ip_type (Optional[VpcEndpointDnsRecordIpType]) – Type of DNS records created for the VPC endpoint. Default: not specified

  • ip_address_type (Optional[VpcEndpointIpAddressType]) – The IP address type for the endpoint. Default: not specified

  • subnets (Optional[Sequence[Union[SubnetSelection, Dict[str, Any]]]]) – Where to add endpoint routing. By default, this endpoint will be routable from all subnets in the VPC. Specify a list of subnet selection objects here to be more specific. Default: - All subnets in the VPC

ExampleMetadata:

fixture=with-vpc infused

Example:

# Interface endpoint with IPv6
vpc.add_interface_endpoint("ExampleEndpoint",
    service=ec2.InterfaceVpcEndpointAwsService.ECR,
    ip_address_type=ec2.VpcEndpointIpAddressType.IPV6,
    dns_record_ip_type=ec2.VpcEndpointDnsRecordIpType.IPV6
)

# Gateway endpoint with dualstack
vpc.add_gateway_endpoint("S3DualstackEndpoint",
    service=ec2.GatewayVpcEndpointAwsService.S3,
    ip_address_type=ec2.VpcEndpointIpAddressType.DUALSTACK,
    dns_record_ip_type=ec2.VpcEndpointDnsRecordIpType.DUALSTACK
)

Attributes

dns_record_ip_type

Type of DNS records created for the VPC endpoint.

Default:

not specified

ip_address_type

The IP address type for the endpoint.

Default:

not specified

service

The service to use for this gateway VPC endpoint.

subnets

Where to add endpoint routing.

By default, this endpoint will be routable from all subnets in the VPC. Specify a list of subnet selection objects here to be more specific.

Default:
  • All subnets in the VPC

Example:

# vpc: ec2.Vpc


vpc.add_gateway_endpoint("DynamoDbEndpoint",
    service=ec2.GatewayVpcEndpointAwsService.DYNAMODB,
    # Add only to ISOLATED subnets
    subnets=[ec2.SubnetSelection(subnet_type=ec2.SubnetType.PRIVATE_ISOLATED)
    ]
)