Skip to content

Conversation

@yuth
Copy link
Contributor

@yuth yuth commented Feb 24, 2022

When a nested stack gets a custom tags the tag gets applied only to the resources defined in the stack and not the stack itself. This change fixes this issue and applies the tag to the nested stack as well. This was caused by NestedStack subclassing Stack but not using the NestedStack.tags in the CfnStack (as it accepts only CfnTag[] and not TagManager)

This change updates the _prepareTemplateAsset to get all the tags added to the CfnStack from NestedStack.tag before rendering the stack

fixes #17463


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

@gitpod-io
Copy link

gitpod-io bot commented Feb 24, 2022

@github-actions github-actions bot added the @aws-cdk/aws-cloudformation Related to AWS CloudFormation label Feb 24, 2022
When a nested stack gets a custom tags the tag gets applied only to the resources defined in the stack and not the stack itself. This change fixes this issue and applies the tag to the nested stack as well
This was caused by NestedStack subclassing Stack but not using the NestedStack.tags in the CfnStack resource that was created by it and not rendering the tags that were added when creating the AWS::CloudFormation::Stack. This change updates the `_prepareTemplateAsset` to get all the tags added to the nested stacks instance TagManager and add them to the CfnStack before rendering the assets

fixes aws#17463
@mergify
Copy link
Contributor

mergify bot commented Feb 26, 2022

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@yuth yuth marked this pull request as ready for review February 26, 2022 17:52
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 406ef9d
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit 3af329b into aws:master Feb 26, 2022
@mergify
Copy link
Contributor

mergify bot commented Feb 26, 2022

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@aws-cdk/aws-cloudformation Related to AWS CloudFormation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(core): tags not applied to NestedStack resource

3 participants