Skip to content
v2.274.0

GatewayVpcEndpointProps Struct ​

Construction properties for a GatewayVpcEndpoint.

Example ​

ts
const stack = new Stack();
const myVpc = new VpcV2(this, 'Vpc');
const routeTable = new RouteTable(this, 'RouteTable', {
  vpc: myVpc,
});
const subnet = new SubnetV2(this, 'Subnet', {
  vpc: myVpc,
  availabilityZone: 'eu-west-2a',
  ipv4CidrBlock: new IpCidr('10.0.0.0/24'),
  subnetType: SubnetType.PRIVATE });

const dynamoEndpoint = new ec2.GatewayVpcEndpoint(this, 'DynamoEndpoint', {
  service: ec2.GatewayVpcEndpointAwsService.DYNAMODB,
  vpc: myVpc,
  subnets: [subnet],
});
new Route(this, 'DynamoDBRoute', {
  routeTable,
  destination: '0.0.0.0/0',
  target: { endpoint: dynamoEndpoint },
});

Properties ​

dnsRecordIpTypeoptionalVpcEndpointDnsRecordIpTypedns_record_ip_typeoptionalVpcEndpointDnsRecordIpTypednsRecordIpTypeoptionalVpcEndpointDnsRecordIpTypeDnsRecordIpTypeoptionalVpcEndpointDnsRecordIpTypeDnsRecordIpTypeoptionalVpcEndpointDnsRecordIpType#
Type of DNS records created for the VPC endpoint.

Default: not specified

ipAddressTypeoptionalVpcEndpointIpAddressTypeip_address_typeoptionalVpcEndpointIpAddressTypeipAddressTypeoptionalVpcEndpointIpAddressTypeIpAddressTypeoptionalVpcEndpointIpAddressTypeIpAddressTypeoptionalVpcEndpointIpAddressType#
The IP address type for the endpoint.

Default: not specified

The service to use for this gateway VPC endpoint.
subnetsoptionalSubnetSelection[]subnetsoptionaltyping.List[SubnetSelection]subnetsoptionalList<SubnetSelection>SubnetsoptionalSubnetSelection[]Subnetsoptional*[]SubnetSelection#
Where to add endpoint routing.

Default: All subnets in the VPC

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 }
  ]
});
vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpcrequired#
The VPC network in which the gateway endpoint will be used.