interface GatewayVpcEndpointOptions
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.EC2.GatewayVpcEndpointOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#GatewayVpcEndpointOptions |
Java | software.amazon.awscdk.services.ec2.GatewayVpcEndpointOptions |
Python | aws_cdk.aws_ec2.GatewayVpcEndpointOptions |
TypeScript (source) | aws-cdk-lib » aws_ec2 » GatewayVpcEndpointOptions |
Options to add a gateway endpoint to a VPC.
Example
// 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
| Name | Type | Description |
|---|---|---|
| service | IGateway | The service to use for this gateway VPC endpoint. |
| dns | Vpc | Type of DNS records created for the VPC endpoint. |
| ip | Vpc | The IP address type for the endpoint. |
| subnets? | Subnet[] | Where to add endpoint routing. |
service
Type:
IGateway
The service to use for this gateway VPC endpoint.
dnsRecordIpType?
Type:
Vpc
(optional, default: not specified)
Type of DNS records created for the VPC endpoint.
ipAddressType?
Type:
Vpc
(optional, default: not specified)
The IP address type for the endpoint.
subnets?
Type:
Subnet[]
(optional, default: 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
declare const vpc: ec2.Vpc;
vpc.addGatewayEndpoint('DynamoDbEndpoint', {
service: ec2.GatewayVpcEndpointAwsService.DYNAMODB,
// Add only to ISOLATED subnets
subnets: [
{ subnetType: ec2.SubnetType.PRIVATE_ISOLATED }
]
});

.NET
Go
Java
Python
TypeScript (