Creates a new CIDR allocator with the provided configuration.
The configuration to use for allocation, including base CIDR, accounts, regions, and subnet types
Optional
cidrTracker: CidrTrackerOptional tracker for allocated CIDRs (for dependency injection)
Generates IP allocations for all accounts, regions, and subnets. This is the main entry point for the allocation process.
An array of allocation objects representing all subnet allocations
If the allocation cannot be completed due to insufficient space, overlapping CIDRs, or invalid inputs
const allocator = new CidrAllocator(config);
const allocations = allocator.generateAllocations();
// allocations contains all subnet CIDRs for all accounts, regions, and AZs
Class responsible for allocating CIDRs at each level of the hierarchy.
The allocation follows a top-down approach:
The allocation is deterministic, meaning the same input will always produce the same output, and ensures no CIDR overlaps occur.