Skip to content

feat(core): add git source metadata to CloudFormation templates#37366

Closed
otaviomacedo wants to merge 1 commit intomainfrom
otaviom/git-source-metadata
Closed

feat(core): add git source metadata to CloudFormation templates#37366
otaviomacedo wants to merge 1 commit intomainfrom
otaviom/git-source-metadata

Conversation

@otaviomacedo
Copy link
Copy Markdown
Contributor

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.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

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.
@otaviomacedo otaviomacedo requested a review from a team as a code owner March 26, 2026 11:09
@aws-cdk-automation aws-cdk-automation requested a review from a team March 26, 2026 11:10
@github-actions github-actions bot added the p2 label Mar 26, 2026
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Mar 26, 2026
@mergify mergify bot requested a deployment to test-pipeline March 26, 2026 11:11 Waiting
Copy link
Copy Markdown
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

contribution/core This is a PR that came from AWS. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants