feat: Add CloudFormation resource counting feature#172
Open
feat: Add CloudFormation resource counting feature#172
Conversation
Implements issue #158 to enhance CDK synth with resource limit warnings: - Add count-resources script to analyze CloudFormation templates - Count resources per stack and warn when approaching 500 resource limit - Default warning threshold at 450 resources (configurable) - Add resource counts to GitHub workflow summary - Add PR comments with resource count details on pull requests - New CDKPipelineOptions: resourceCountWarningThreshold and enableResourceCounting The feature is enabled by default and helps prevent hitting CloudFormation's hard limit of 500 resources per stack by providing early warnings.
… support - Move provideResourceCountStep() to base CDKPipeline class - Update GitHub to use base implementation - Add resource counting to GitLab synth job (writes to console) - Add GitLab MR comment workflow for resource counts - GitLab MR comments use GitLab API to post/update comments - Resource counting now works consistently across GitHub and GitLab
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
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.