Resource: awsVpcIpamPoolCidrAllocation
Allocates (reserves) a CIDR from an IPAM address pool, preventing usage by IPAM. Only works for private IPv4.
Example Usage
Basic usage:
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const dataAwsRegionCurrent = new aws.dataAwsRegion.DataAwsRegion(
this,
"current",
{}
);
const awsVpcIpamExample = new aws.vpcIpam.VpcIpam(this, "example", {
operatingRegions: [
{
regionName: dataAwsRegionCurrent.name,
},
],
});
const awsVpcIpamPoolExample = new aws.vpcIpamPool.VpcIpamPool(
this,
"example_2",
{
addressFamily: "ipv4",
ipamScopeId: awsVpcIpamExample.privateDefaultScopeId,
locale: dataAwsRegionCurrent.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsVpcIpamPoolExample.overrideLogicalId("example");
const awsVpcIpamPoolCidrExample = new aws.vpcIpamPoolCidr.VpcIpamPoolCidr(
this,
"example_3",
{
cidr: "172.2.0.0/16",
ipamPoolId: awsVpcIpamPoolExample.id,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsVpcIpamPoolCidrExample.overrideLogicalId("example");
const awsVpcIpamPoolCidrAllocationExample =
new aws.vpcIpamPoolCidrAllocation.VpcIpamPoolCidrAllocation(
this,
"example_4",
{
cidr: "172.2.0.0/24",
depends_on: [`\${${awsVpcIpamPoolCidrExample.fqn}}`],
ipamPoolId: awsVpcIpamPoolExample.id,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsVpcIpamPoolCidrAllocationExample.overrideLogicalId("example");
With the disallowedCidrs
attribute:
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const dataAwsRegionCurrent = new aws.dataAwsRegion.DataAwsRegion(
this,
"current",
{}
);
const awsVpcIpamExample = new aws.vpcIpam.VpcIpam(this, "example", {
operatingRegions: [
{
regionName: dataAwsRegionCurrent.name,
},
],
});
const awsVpcIpamPoolExample = new aws.vpcIpamPool.VpcIpamPool(
this,
"example_2",
{
addressFamily: "ipv4",
ipamScopeId: awsVpcIpamExample.privateDefaultScopeId,
locale: dataAwsRegionCurrent.name,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsVpcIpamPoolExample.overrideLogicalId("example");
const awsVpcIpamPoolCidrExample = new aws.vpcIpamPoolCidr.VpcIpamPoolCidr(
this,
"example_3",
{
cidr: "172.2.0.0/16",
ipamPoolId: awsVpcIpamPoolExample.id,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsVpcIpamPoolCidrExample.overrideLogicalId("example");
const awsVpcIpamPoolCidrAllocationExample =
new aws.vpcIpamPoolCidrAllocation.VpcIpamPoolCidrAllocation(
this,
"example_4",
{
depends_on: [`\${${awsVpcIpamPoolCidrExample.fqn}}`],
disallowedCidrs: ["172.2.0.0/28"],
ipamPoolId: awsVpcIpamPoolExample.id,
netmaskLength: 28,
}
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsVpcIpamPoolCidrAllocationExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
cidr
- (Optional) The CIDR you want to assign to the pool.description
- (Optional) The description for the allocation.disallowedCidrs
- (Optional) Exclude a particular CIDR range from being returned by the pool.ipamPoolId
- (Required) The ID of the pool to which you want to assign a CIDR.netmaskLength
- (Optional) The netmask length of the CIDR you would like to allocate to the IPAM pool. Valid Values:0128
.
Attributes Reference
In addition to all arguments above, the following attributes are exported:
id
- The ID of the allocation.resourceId
- The ID of the resource.resourceOwner
- The owner of the resource.resourceType
- The type of the resource.
Import
IPAM allocations can be imported using the allocationId
and poolId
, separated by _
, e.g.