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
const vpc = new ec2.Vpc(this, 'TheVPC', {
ipProtocol: ec2.IpProtocol.DUAL_STACK,
subnetConfiguration: [
{
// general properties
name: 'Public',
subnetType: ec2.SubnetType.PUBLIC,
reserved: false,
// IPv4 specific properties
mapPublicIpOnLaunch: true,
cidrMask: 24,
// new IPv6 specific property
ipv6AssignAddressOnCreation: true,
},
],
});
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.