CfnIPAMPoolProps Struct
Properties for defining a CfnIPAMPool.
| Source | |
|---|---|
| Type last changed |
Example
declare const vpc: ec2.Vpc;
declare const ipam: ec2.CfnIPAM;
const pool = new ec2.CfnIPAMPool(this, 'SubnetPool', {
addressFamily: 'ipv4',
ipamScopeId: ipam.attrPrivateDefaultScopeId,
locale: this.region,
sourceResource: {
resourceId: vpc.vpcId,
resourceOwner: this.account,
resourceRegion: this.region,
resourceType: 'vpc',
},
provisionedCidrs: [{ cidr: vpc.vpcCidrBlock }],
});
const subnet = new ec2.Subnet(this, 'IpamSubnet', {
vpcId: vpc.vpcId,
availabilityZone: vpc.availabilityZones[0],
ipv4IpamAllocation: {
ipamPool: pool,
netmaskLength: 24,
},
});
# vpc: ec2.Vpc
# ipam: ec2.CfnIPAM
pool = ec2.CfnIPAMPool(self, "SubnetPool",
address_family="ipv4",
ipam_scope_id=ipam.attr_private_default_scope_id,
locale=self.region,
source_resource=ec2.CfnIPAMPool.SourceResourceProperty(
resource_id=vpc.vpc_id,
resource_owner=self.account,
resource_region=self.region,
resource_type="vpc"
),
provisioned_cidrs=[ec2.CfnIPAMPool.ProvisionedCidrProperty(cidr=vpc.vpc_cidr_block)]
)
subnet = ec2.Subnet(self, "IpamSubnet",
vpc_id=vpc.vpc_id,
availability_zone=vpc.availability_zones[0],
ipv4_ipam_allocation=ec2.SubnetIpv4IpamAllocation(
ipam_pool=pool,
netmask_length=24
)
)
Vpc vpc;
CfnIPAM ipam;
CfnIPAMPool pool = CfnIPAMPool.Builder.create(this, "SubnetPool")
.addressFamily("ipv4")
.ipamScopeId(ipam.getAttrPrivateDefaultScopeId())
.locale(this.region)
.sourceResource(SourceResourceProperty.builder()
.resourceId(vpc.getVpcId())
.resourceOwner(this.account)
.resourceRegion(this.region)
.resourceType("vpc")
.build())
.provisionedCidrs(List.of(ProvisionedCidrProperty.builder().cidr(vpc.getVpcCidrBlock()).build()))
.build();
Subnet subnet = Subnet.Builder.create(this, "IpamSubnet")
.vpcId(vpc.getVpcId())
.availabilityZone(vpc.getAvailabilityZones()[0])
.ipv4IpamAllocation(SubnetIpv4IpamAllocation.builder()
.ipamPool(pool)
.netmaskLength(24)
.build())
.build();
// Install: dotnet add package Amazon.CDK.Lib
Vpc vpc;
CfnIPAM ipam;
var pool = new CfnIPAMPool(this, "SubnetPool", new CfnIPAMPoolProps {
AddressFamily = "ipv4",
IpamScopeId = ipam.AttrPrivateDefaultScopeId,
Locale = Region,
SourceResource = new SourceResourceProperty {
ResourceId = vpc.VpcId,
ResourceOwner = Account,
ResourceRegion = Region,
ResourceType = "vpc"
},
ProvisionedCidrs = new [] { new ProvisionedCidrProperty { Cidr = vpc.VpcCidrBlock } }
});
var subnet = new Subnet(this, "IpamSubnet", new SubnetProps {
VpcId = vpc.VpcId,
AvailabilityZone = vpc.AvailabilityZones[0],
Ipv4IpamAllocation = new SubnetIpv4IpamAllocation {
IpamPool = pool,
NetmaskLength = 24
}
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var vpc Vpc
var ipam CfnIPAM
pool := ec2.NewCfnIPAMPool(this, jsii.String("SubnetPool"), &CfnIPAMPoolProps{
AddressFamily: jsii.String("ipv4"),
IpamScopeId: ipam.attrPrivateDefaultScopeId,
Locale: this.Region,
SourceResource: &SourceResourceProperty{
ResourceId: vpc.VpcId,
ResourceOwner: this.Account,
ResourceRegion: this.*Region,
ResourceType: jsii.String("vpc"),
},
ProvisionedCidrs: []interface{}{
&ProvisionedCidrProperty{
Cidr: vpc.VpcCidrBlock,
},
},
})
subnet := ec2.NewSubnet(this, jsii.String("IpamSubnet"), &SubnetProps{
VpcId: vpc.*VpcId,
AvailabilityZone: vpc.AvailabilityZones[jsii.Number(0)],
Ipv4IpamAllocation: &SubnetIpv4IpamAllocation{
IpamPool: pool,
NetmaskLength: jsii.Number(24),
},
})
Properties
addressFamilystringaddress_familystraddressFamilyStringAddressFamilystringAddressFamily*string required #allocationDefaultNetmaskLengthoptionalnumberallocation_default_netmask_lengthoptionalint | floatallocationDefaultNetmaskLengthoptionalNumberAllocationDefaultNetmaskLengthoptionaldoubleAllocationDefaultNetmaskLengthoptional*float64 #If, for example, the CIDR assigned to this pool is 10.0.0.0/8 and you enter 16 here, new allocations will default to 10.0.0.0/16.
allocationMaxNetmaskLengthoptionalnumberallocation_max_netmask_lengthoptionalint | floatallocationMaxNetmaskLengthoptionalNumberAllocationMaxNetmaskLengthoptionaldoubleAllocationMaxNetmaskLengthoptional*float64 #The maximum netmask length must be greater than the minimum netmask length. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.
allocationMinNetmaskLengthoptionalnumberallocation_min_netmask_lengthoptionalint | floatallocationMinNetmaskLengthoptionalNumberAllocationMinNetmaskLengthoptionaldoubleAllocationMinNetmaskLengthoptional*float64 #The minimum netmask length must be less than the maximum netmask length. Possible netmask lengths for IPv4 addresses are 0 - 32. Possible netmask lengths for IPv6 addresses are 0 - 128.
allocationResourceTagsoptionalIResolvable | IResolvable | CfnTag[]allocation_resource_tagsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, CfnTag]]]allocationResourceTagsoptionalIResolvableAllocationResourceTagsoptionalIResolvableAllocationResourceTagsoptionalinterface{} #notes
Resources that do not have these tags will not be allowed to allocate space from the pool. If the resources have their tags changed after they have allocated space or if the allocation tagging requirements are changed on the pool, the resource may be marked as noncompliant.
autoImportoptionalboolean | IResolvableauto_importoptionaltyping.Union[bool, IResolvable]autoImportoptionalBooleanAutoImportoptionalboolAutoImportoptionalinterface{} #notes
The CIDRs that will be allocated for these resources must not already be allocated to other resources in order for the import to succeed. IPAM will import a CIDR regardless of its compliance with the pool's allocation rules, so a resource might be imported and subsequently marked as noncompliant. If IPAM discovers multiple CIDRs that overlap, IPAM will import the largest CIDR only. If IPAM discovers multiple CIDRs with matching CIDRs, IPAM will randomly import one of them only.
A locale must be set on the pool for this feature to work.
awsServiceoptionalstringaws_serviceoptionalstrawsServiceoptionalStringAwsServiceoptionalstringAwsServiceoptional*string #"ec2", for example, allows users to use space for Elastic IP addresses and VPCs.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #localeoptionalstringlocaleoptionalstrlocaleoptionalStringLocaleoptionalstringLocaleoptional*string #notes
The locale for the pool should be one of the following:
- An AWS Region where you want this IPAM pool to be available for allocations.
- The network border group for an AWS Local Zone where you want this IPAM pool to be available for allocations ( supported Local Zones ). This option is only available for IPAM IPv4 pools in the public scope.
If you choose an AWS Region for locale that has not been configured as an operating Region for the IPAM, you'll get an error.
provisionedCidrsoptionalIResolvable | IResolvable | CfnIPAMPool.provisioned_cidrsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ProvisionedCidrProperty]]]provisionedCidrsoptionalIResolvableProvisionedCidrsoptionalIResolvableProvisionedCidrsoptionalinterface{} #publicIpSourceoptionalstringpublic_ip_sourceoptionalstrpublicIpSourceoptionalStringPublicIpSourceoptionalstringPublicIpSourceoptional*string #notes
Only used for provisioning IP address CIDRs to pools in the public scope. Default is BYOIP . For more information, see Create IPv6 pools in the Amazon VPC IPAM User Guide . By default, you can add only one Amazon-provided IPv6 CIDR block to a top-level IPv6 pool. For information on increasing the default limit, see Quotas for your IPAM in the Amazon VPC IPAM User Guide .
publiclyAdvertisableoptionalboolean | IResolvablepublicly_advertisableoptionaltyping.Union[bool, IResolvable]publiclyAdvertisableoptionalBooleanPubliclyAdvertisableoptionalboolPubliclyAdvertisableoptionalinterface{} #This option is not available for pools with AddressFamily set to ipv4 .
sourceIpamPoolIdoptionalstringsource_ipam_pool_idoptionalstrsourceIpamPoolIdoptionalStringSourceIpamPoolIdoptionalstringSourceIpamPoolIdoptional*string #You can use this option to create an IPAM pool within an existing source pool.
sourceResourceoptionalIResolvable | CfnIPAMPool.source_resourceoptionaltyping.Union[IResolvable, SourceResourceProperty]sourceResourceoptionalIResolvableSourceResourceoptionalIResolvableSourceResourceoptionalinterface{} #tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #notes
Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA , specify tag:Owner for the filter name and TeamA for the filter value.