aws-cdk-lib.aws_ec2.GatewayVpcEndpointProps

interface GatewayVpcEndpointProps

LanguageType name
.NETAmazon.CDK.AWS.EC2.GatewayVpcEndpointProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsec2#GatewayVpcEndpointProps
Javasoftware.amazon.awscdk.services.ec2.GatewayVpcEndpointProps
Pythonaws_cdk.aws_ec2.GatewayVpcEndpointProps
TypeScript (source)aws-cdk-lib » aws_ec2 » GatewayVpcEndpointProps

Construction properties for a GatewayVpcEndpoint.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';

declare const gatewayVpcEndpointService: ec2.IGatewayVpcEndpointService;
declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpc: ec2.Vpc;
const gatewayVpcEndpointProps: ec2.GatewayVpcEndpointProps = {
  service: gatewayVpcEndpointService,
  vpc: vpc,

  // the properties below are optional
  subnets: [{
    availabilityZones: ['availabilityZones'],
    onePerAz: false,
    subnetFilters: [subnetFilter],
    subnetGroupName: 'subnetGroupName',
    subnets: [subnet],
    subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
  }],
};

Properties

NameTypeDescription
serviceIGatewayVpcEndpointServiceThe service to use for this gateway VPC endpoint.
vpcIVpcThe VPC network in which the gateway endpoint will be used.
subnets?SubnetSelection[]Where to add endpoint routing.

service

Type: IGatewayVpcEndpointService

The service to use for this gateway VPC endpoint.


vpc

Type: IVpc

The VPC network in which the gateway endpoint will be used.


subnets?

Type: SubnetSelection[] (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 }
  ]
});