feat: add per-tier subnet sizing support#60
Conversation
- Add optional per-tier newbits variables (public_newbits, private_newbits, etc.) - Maintain 100% backward compatibility with existing 'newbits' variable - Enable mixed subnet sizes within same VPC (e.g., /24 for private, /26 for transit) - Update README with usage example
|
⏳ Code review in progress. Analyzing for code quality issues and best practices. You can monitor the review status in the checks section at the bottom of this pull request. Detailed findings will be posted upon completion. Using Amazon Q Developer for GitHubAmazon Q Developer1 is an AI-powered assistant that integrates directly into your GitHub workflow, enhancing your development process with intelligent features for code development, review, and transformation. Slash Commands
FeaturesAgentic Chat Code Review CustomizationYou can create project-specific rules for Amazon Q Developer to follow:
Example rule: FeedbackTo provide feedback on Amazon Q Developer, create an issue in the Amazon Q Developer public repository. For more detailed information, visit the Amazon Q for GitHub documentation. Footnotes
|
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for per-tier subnet sizing by introducing tier-specific newbits variables that can override the global newbits setting. This allows users to create subnets of different sizes for different tiers (public, private, secure, transit, firewall) within the same VPC.
- Introduced five new optional variables (
public_newbits,private_newbits,secure_newbits,transit_newbits,firewall_newbits) that override the globalnewbitswhen set - Updated all subnet resources to use tier-specific effective newbits values computed via
coalesce()logic - Added documentation and usage examples in README
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| _variables.tf | Added five new tier-specific newbits variables with null defaults and updated the global newbits description |
| _data.tf | Added local values to compute effective newbits per tier using coalesce to fallback to global newbits |
| subnet-public.tf | Updated to use local.public_newbits_effective instead of var.newbits |
| subnet-private.tf | Updated to use local.private_newbits_effective instead of var.newbits |
| subnet-secure.tf | Updated to use local.secure_newbits_effective instead of var.newbits |
| subnet-transit.tf | Updated to use local.transit_newbits_effective instead of var.newbits |
| subnet-firewall.tf | Updated to use local.firewall_newbits_effective instead of var.newbits |
| README.md | Added usage example demonstrating per-tier subnet sizing configuration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Move subnet-specific newbits locals to existing locals block for better organization and consistency
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.
Types of changes
What types of changes does your code introduce to <repo_name>?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
Adds optional per-tier subnet sizing support for mixed subnet sizes within a VPC.
Changes
public_newbits,private_newbits,secure_newbits,transit_newbits,firewall_newbitsvariablesBackward Compatibility
✅ 100% backward compatible - existing configurations work unchanged
newbits(existing behavior)Use Case
Enables efficient IP allocation for hub-and-spoke architectures:
hcl
vpc_cidr = "10.39.32.0/21"
newbits = 5 # Default /26
private_newbits = 3 # Override: /24 for applications
Testing
Suggested Release
v2.4.0 (minor version - new feature, backward compatible)