Skip to content
v2.273.0

GatewayVpcEndpointOptions Struct ​

Options to add a gateway endpoint to a VPC.

Example ​

ts
// Interface endpoint with IPv6
vpc.addInterfaceEndpoint('ExampleEndpoint', {
  service: ec2.InterfaceVpcEndpointAwsService.ECR,
  ipAddressType: ec2.VpcEndpointIpAddressType.IPV6,
  dnsRecordIpType: ec2.VpcEndpointDnsRecordIpType.IPV6,
});

// Gateway endpoint with dualstack
vpc.addGatewayEndpoint('S3DualstackEndpoint', {
  service: ec2.GatewayVpcEndpointAwsService.S3,
  ipAddressType: ec2.VpcEndpointIpAddressType.DUALSTACK,
  dnsRecordIpType: ec2.VpcEndpointDnsRecordIpType.DUALSTACK,
});

Properties ​

dnsRecordIpTypeVpcEndpointDnsRecordIpTypedns_record_ip_typeVpcEndpointDnsRecordIpTypednsRecordIpTypeVpcEndpointDnsRecordIpTypeDnsRecordIpTypeVpcEndpointDnsRecordIpTypeDnsRecordIpTypeVpcEndpointDnsRecordIpType= not specified#
Type of DNS records created for the VPC endpoint.
ipAddressTypeVpcEndpointIpAddressTypeip_address_typeVpcEndpointIpAddressTypeipAddressTypeVpcEndpointIpAddressTypeIpAddressTypeVpcEndpointIpAddressTypeIpAddressTypeVpcEndpointIpAddressType= not specified#
The IP address type for the endpoint.
The service to use for this gateway VPC endpoint.
subnetsSubnetSelection[]subnetstyping.List[SubnetSelection]subnetsList<SubnetSelection>SubnetsSubnetSelection[]Subnets*[]SubnetSelection= All subnets in the VPC#
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.

example
ts
declare const vpc: ec2.Vpc;

vpc.addGatewayEndpoint('DynamoDbEndpoint', {
  service: ec2.GatewayVpcEndpointAwsService.DYNAMODB,
  // Add only to ISOLATED subnets
  subnets: [
    { subnetType: ec2.SubnetType.PRIVATE_ISOLATED }
  ]
});