Skip to content
v2.278.0

AwsIpamProps Struct ​

Configuration for AwsIpam.

Example ​

ts
import { IpAddresses } from 'aws-cdk-lib/aws-ec2';

declare const pool: ec2.CfnIPAMPool;

new ec2.Vpc(this, 'TheVPC', {
  ipAddresses: IpAddresses.awsIpamAllocation({
    ipv4IpamPoolId: pool.ref,
    ipv4NetmaskLength: 18,
    defaultSubnetIpv4NetmaskLength: 24
  })
});
python
from aws_cdk.aws_ec2 import IpAddresses

# pool: ec2.CfnIPAMPool


ec2.Vpc(self, "TheVPC",
    ip_addresses=IpAddresses.aws_ipam_allocation(
        ipv4_ipam_pool_id=pool.ref,
        ipv4_netmask_length=18,
        default_subnet_ipv4_netmask_length=24
    )
)
java
import software.amazon.awscdk.services.ec2.IpAddresses;

CfnIPAMPool pool;


Vpc.Builder.create(this, "TheVPC")
        .ipAddresses(IpAddresses.awsIpamAllocation(AwsIpamProps.builder()
                .ipv4IpamPoolId(pool.getRef())
                .ipv4NetmaskLength(18)
                .defaultSubnetIpv4NetmaskLength(24)
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.EC2;

CfnIPAMPool pool;


new Vpc(this, "TheVPC", new VpcProps {
    IpAddresses = IpAddresses.AwsIpamAllocation(new AwsIpamProps {
        Ipv4IpamPoolId = pool.Ref,
        Ipv4NetmaskLength = 18,
        DefaultSubnetIpv4NetmaskLength = 24
    })
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import "github.com/aws/aws-cdk-go/awscdk"

var pool CfnIPAMPool


ec2.NewVpc(this, jsii.String("TheVPC"), &VpcProps{
	IpAddresses: awscdk.IpAddresses_AwsIpamAllocation(&AwsIpamProps{
		Ipv4IpamPoolId: pool.ref,
		Ipv4NetmaskLength: jsii.Number(18),
		DefaultSubnetIpv4NetmaskLength: jsii.Number(24),
	}),
})

Properties ​

defaultSubnetIpv4NetmaskLengthoptionalnumberdefault_subnet_ipv4_netmask_lengthoptionalint | floatdefaultSubnetIpv4NetmaskLengthoptionalNumberDefaultSubnetIpv4NetmaskLengthoptionaldoubleDefaultSubnetIpv4NetmaskLengthoptional*float64 #
Default length for Subnet ipv4 Network mask.

Default: Default ipv4 Subnet Mask for subnets in Vpc

Specify this option only if you do not specify all Subnets using SubnetConfiguration with a cidrMask

ipv4IpamPoolIdstringipv4_ipam_pool_idstripv4IpamPoolIdStringIpv4IpamPoolIdstringIpv4IpamPoolId*string required #
Ipam Pool Id for ipv4 allocation.
ipv4NetmaskLengthnumberipv4_netmask_lengthint | floatipv4NetmaskLengthNumberIpv4NetmaskLengthdoubleIpv4NetmaskLength*float64 required #
Netmask length for Vpc.