feat(core): add git source metadata to CloudFormation templates#37366
Closed
otaviomacedo wants to merge 1 commit intomainfrom
Closed
feat(core): add git source metadata to CloudFormation templates#37366otaviomacedo wants to merge 1 commit intomainfrom
otaviomacedo wants to merge 1 commit intomainfrom
Conversation
Synthesized CloudFormation templates now include an `AWS::CloudFormation::Source`
entry in the top-level `Metadata` section containing the git remote repository
URL and the latest commit hash. This helps trace deployed stacks back to their
source code.
Example output:
Metadata:
AWS::CloudFormation::Source:
Repository: [email protected]:org/app.git
Commit: 19e3e594a5512b75074526af89bf3b67a3164cc1
The metadata is generated by default. It can be suppressed by:
- Setting the `CDK_DISABLE_GIT_SOURCE` environment variable
- Setting the `@aws-cdk/core:disableGitSource` context key to `true`
If the current directory is not a git repository or git is not available,
the metadata entry is silently omitted.
aws-cdk-automation
requested changes
Mar 26, 2026
Collaborator
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter fails with the following errors:
❌ Features must contain a change to a README file.
❌ Features must contain a change to an integration test file and the resulting snapshot.
If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.
Contributor
|
Comments on closed issues and PRs are hard for our team to see. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Synthesized CloudFormation templates now include an
AWS::CloudFormation::Sourceentry in the top-levelMetadatasection containing the git remote repository URL and the latest commit hash. This helps trace deployed stacks back to their source code.Example output:
The metadata is generated by default. It can be suppressed by:
CDK_DISABLE_GIT_SOURCEenvironment variable@aws-cdk/core:disableGitSourcecontext key totrueIf the current directory is not a git repository or git is not available, the metadata entry is silently omitted.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license