Conversation
- Implement IpamPool construct for centralized IP address management - Implement IpamPoolStaticCidr construct for static CIDR allocations - Add comprehensive CIDR validation utilities with overlap detection - Support hierarchical pool structures with parent-child relationships - Include automatic address count calculation from CIDR blocks - Add extensive unit tests for IPAM constructs and CIDR utilities - Update README with complete IPAM documentation and examples - Export IPAM constructs and utilities in module index - Add API schemas for both 2023-11-01 and 2024-05-01 versions
lukeorellana
approved these changes
Dec 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add IPAM Pool and Static CIDR Support to Virtual Network Manager
Overview
This PR adds comprehensive IP Address Management (IPAM) capabilities to the Azure Virtual Network Manager module, enabling centralized IP address space management at scale.
What's Changed
New Constructs
IpamPool: Manages IP address pools with automatic overlap detection and hierarchical organizationIpamPoolStaticCidr: Enables static CIDR block allocation within pools for dedicated purposesCIDR Validation Utilities
Added comprehensive CIDR validation utilities in
cidr-validator.ts:isValidCidr()- Validates CIDR notation formatcidrsOverlap()- Detects overlapping CIDR blockscalculateAddressCount()- Calculates IP addresses in a CIDRisSubnet()- Validates parent-child CIDR relationshipsisPrivateRange()- Checks if CIDR is within RFC 1918 rangesparseCidr()- Parses CIDR into structured informationKey Features
✅ Centralized IP Management - Manage IP addresses across multiple VNets from a single location
✅ Overlap Prevention - Automatic validation prevents overlapping CIDR blocks
✅ Hierarchical Pools - Support for parent-child pool relationships
✅ Static Allocations - Reserve specific CIDR blocks within pools
✅ Multi-Version Support - Supports API versions 2023-11-01 and 2024-05-01
✅ Type-Safe - Full TypeScript support with comprehensive interfaces
✅ Well-Tested - Extensive unit tests for all constructs and utilities
Files Changed
New Files
src/azure-virtualnetworkmanager/lib/ipam-pool.ts- IPAM Pool constructsrc/azure-virtualnetworkmanager/lib/ipam-pool-schemas.ts- IPAM Pool API schemassrc/azure-virtualnetworkmanager/lib/ipam-pool-static-cidr.ts- Static CIDR constructsrc/azure-virtualnetworkmanager/lib/ipam-pool-static-cidr-schemas.ts- Static CIDR API schemassrc/azure-virtualnetworkmanager/lib/utils/cidr-validator.ts- CIDR validation utilitiessrc/azure-virtualnetworkmanager/test/ipam-pool.spec.ts- IPAM Pool unit testssrc/azure-virtualnetworkmanager/test/ipam-pool-static-cidr.spec.ts- Static CIDR unit testssrc/azure-virtualnetworkmanager/test/cidr-validator.spec.ts- CIDR validator unit testsModified Files
src/azure-virtualnetworkmanager/lib/index.ts- Export new constructs and utilitiessrc/azure-virtualnetworkmanager/README.md- Add comprehensive IPAM documentationsrc/azure-virtualnetworkmanager/lib/virtual-network-manager.ts- Minor updatessrc/azure-virtualnetworkmanager/test/virtual-network-manager.spec.ts- Updated testssrc/azure-virtualnetworkmanager/test/virtual-network-manager.integ.ts- Updated integration testsAPI.md- Updated API documentationUsage Example
Testing
Unit Tests
All new constructs include comprehensive unit tests:
Run tests with:
npm testIntegration Tests
Integration tests updated to include IPAM pool scenarios.
Documentation
README.mdincluding:Regional Limitations
Breaking Changes
None - This is a purely additive change that introduces new functionality without modifying existing constructs.
Checklist
Related Issues
Implements IPAM functionality for Azure Virtual Network Manager as part of the networking constructs expansion.