enum IpProtocol
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.IpProtocol |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#IpProtocol |
Java | software.amazon.awscdk.services.ec2.IpProtocol |
Python | aws_cdk.aws_ec2.IpProtocol |
TypeScript (source) | aws-cdk-lib » aws_ec2 » IpProtocol |
The types of IP addresses provisioned in the VPC.
Example
import * as elbv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
// The VPC and subnet must have associated IPv6 CIDR blocks.
const vpc = new ec2.Vpc(this, 'Vpc', {
ipProtocol: ec2.IpProtocol.DUAL_STACK,
});
const cluster = new ecs.Cluster(this, 'EcsCluster', { vpc });
const service = new ecsPatterns.ApplicationLoadBalancedFargateService(this, 'myService', {
cluster,
taskImageOptions: {
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
},
ipAddressType: elbv2.IpAddressType.DUAL_STACK,
});
const applicationLoadBalancedEc2Service = new ecsPatterns.ApplicationLoadBalancedEc2Service(this, 'myService', {
cluster,
taskImageOptions: {
image: ecs.ContainerImage.fromRegistry('amazon/amazon-ecs-sample'),
},
ipAddressType: elbv2.IpAddressType.DUAL_STACK,
});
Members
Name | Description |
---|---|
IPV4_ONLY | The vpc will be configured with only IPv4 addresses. |
DUAL_STACK | The vpc will have both IPv4 and IPv6 addresses. |
IPV4_ONLY
The vpc will be configured with only IPv4 addresses.
This is the default protocol if unset.
DUAL_STACK
The vpc will have both IPv4 and IPv6 addresses.
Unless specified, public IPv4 addresses will not be auto assigned, an egress only internet gateway (EIGW) will be created and configured, and NATs and internet gateways (IGW) will be configured with IPv6 addresses.