Skip to content
GitHubXDiscord

IPAMPoolCidr

The IPAMPoolCidr resource allows you to manage AWS EC2 IPAMPoolCidrs effectively by specifying CIDR blocks within an IP address management (IPAM) pool.

Create a basic IPAMPoolCidr with required properties and a common optional property.

import AWS from "alchemy/aws/control";
const ipamPoolCidr = await AWS.EC2.IPAMPoolCidr("MyIPAMPoolCidr", {
IpamPoolId: "ipam-pool-12345678",
Cidr: "10.0.0.0/24",
NetmaskLength: 24 // Optional: The length of the CIDR netmask
});

Configure an IPAMPoolCidr with adoption of existing resources.

const adoptExistingCidr = await AWS.EC2.IPAMPoolCidr("AdoptedIPAMPoolCidr", {
IpamPoolId: "ipam-pool-87654321",
Cidr: "192.168.1.0/24",
NetmaskLength: 24,
adopt: true // Optional: Adopt existing resource instead of failing
});

Create multiple IPAMPoolCidrs for different subnets within the same IPAM pool.

const subnetA = await AWS.EC2.IPAMPoolCidr("SubnetA", {
IpamPoolId: "ipam-pool-12345678",
Cidr: "10.0.1.0/24",
NetmaskLength: 24
});
const subnetB = await AWS.EC2.IPAMPoolCidr("SubnetB", {
IpamPoolId: "ipam-pool-12345678",
Cidr: "10.0.2.0/24",
NetmaskLength: 24
});

Create an IPAMPoolCidr with a custom netmask length for more granular control.

const customNetmaskCidr = await AWS.EC2.IPAMPoolCidr("CustomNetmaskCidr", {
IpamPoolId: "ipam-pool-12345678",
Cidr: "172.16.0.0/20", // A larger CIDR block
NetmaskLength: 20 // Custom netmask length
});