feat: Add CloudFormation resource counting feature #172
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.
Description
This PR adds a new resource counting feature that monitors CloudFormation resource usage across stacks during the CDK synthesis step. The feature helps teams stay aware of CloudFormation's 500 resource per stack limit and provides warnings when approaching this threshold.
Changes
New Features
src/awscdk/count-resources.ts): A new CLI tool that analyzes CloudFormation templates in the cloud assembly and counts resources per stacksrc/awscdk/resource-count-step.ts): A new pipeline step that integrates resource counting into CI/CD workflowsCDKPipelineOptions:enableResourceCounting(default:true): Toggle resource counting on/offresourceCountWarningThreshold(default:450): Configurable warning thresholdPipeline Integration
Output Formats
resource-count-results.json) for programmatic accessBenefits
Configuration
Users can control the feature via pipeline options:
The feature is enabled by default but can be disabled by setting
enableResourceCounting: false.