Replies: 1 comment
-
I also tried the "add then remove" approach, same as above Tags.of(self).add(key='code-version', value=code_version)
Tags.of(self).remove(key='code-version', exclude_resource_types=['AWS::CloudFormation::Stack']) # and with 'aws:cdk:stack' Same behavior, tag is added everywhere |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am struggling to find a way to apply a tag to the CloudFormation
Stack
resource, but do not apply it to said stacks children. The use case is as follows:Given the above, the "default" path of tagging a stack and all its resources with this version number is not ideal for us. The goal then would be to apply the version tag to just the stack. This would be viewable in the console (in the tags section) and in
aws cloudformation describe-stacks
.I have tried a variety of approaches and nothing seems to work. A few highlights:
Tags.of(self).add
hasinclude_resource_types
andexclude_resource_types
which seem like they could be useful here.AWS::CloudFormation::Stack
(the resource type for a stack) works / is interpreted properly here. I found a github issue in the repo that referenced a type likeaws:cdk:stack
. I could not find this in the documentation but it does seem to work.Things I have tried (all in python):
Beta Was this translation helpful? Give feedback.
All reactions