Skip to content
v2.278.0

VpcEndpointIpAddressType Enum ​

IP address type for the endpoint.

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,
});
python
# 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
)
java
// Interface endpoint with IPv6
vpc.addInterfaceEndpoint("ExampleEndpoint", InterfaceVpcEndpointOptions.builder()
        .service(InterfaceVpcEndpointAwsService.ECR)
        .ipAddressType(VpcEndpointIpAddressType.IPV6)
        .dnsRecordIpType(VpcEndpointDnsRecordIpType.IPV6)
        .build());

// Gateway endpoint with dualstack
vpc.addGatewayEndpoint("S3DualstackEndpoint", GatewayVpcEndpointOptions.builder()
        .service(GatewayVpcEndpointAwsService.S3)
        .ipAddressType(VpcEndpointIpAddressType.DUALSTACK)
        .dnsRecordIpType(VpcEndpointDnsRecordIpType.DUALSTACK)
        .build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
// Interface endpoint with IPv6
vpc.AddInterfaceEndpoint("ExampleEndpoint", new InterfaceVpcEndpointOptions {
    Service = InterfaceVpcEndpointAwsService.ECR,
    IpAddressType = VpcEndpointIpAddressType.IPV6,
    DnsRecordIpType = VpcEndpointDnsRecordIpType.IPV6
});

// Gateway endpoint with dualstack
vpc.AddGatewayEndpoint("S3DualstackEndpoint", new GatewayVpcEndpointOptions {
    Service = GatewayVpcEndpointAwsService.S3,
    IpAddressType = VpcEndpointIpAddressType.DUALSTACK,
    DnsRecordIpType = VpcEndpointDnsRecordIpType.DUALSTACK
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// Interface endpoint with IPv6
vpc.addInterfaceEndpoint(jsii.String("ExampleEndpoint"), &InterfaceVpcEndpointOptions{
	Service: ec2.InterfaceVpcEndpointAwsService_ECR(),
	IpAddressType: ec2.VpcEndpointIpAddressType_IPV6,
	DnsRecordIpType: ec2.VpcEndpointDnsRecordIpType_IPV6,
})

// Gateway endpoint with dualstack
vpc.addGatewayEndpoint(jsii.String("S3DualstackEndpoint"), &GatewayVpcEndpointOptions{
	Service: ec2.GatewayVpcEndpointAwsService_S3(),
	IpAddressType: ec2.VpcEndpointIpAddressType_DUALSTACK,
	DnsRecordIpType: ec2.VpcEndpointDnsRecordIpType_DUALSTACK,
})

Members ​

MemberDescription
IPV4Assign IPv4 addresses to the endpoint network interfaces.
IPV6Assign IPv6 addresses to the endpoint network interfaces.
DUALSTACKAssign both IPv4 and IPv6 addresses to the endpoint network interfaces.

Referenced by ​