-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot use tokens when tagging stacks #4106
Comments
The issue is that you applying the tag on the entire stack ( We won't be able to support deploy-time values in stack tags, but we should definitely improve this experience:
In the meantime, you can do two things:
group = Construct(self, 'Group')
r3 = s3.Bucket(group, 'Bucket')
Tag.add(group, 'Instance', Aws.STACK_NAME) Let me know if this helps. |
@eladb can you provide insight into when you say "only resolved during deployment", I was only receiving this error when I was using Is that not the "during deployment" you're referring to? ergo, shouldn't it be resolved? I'm guessing there's a step in cdk's workflow that I'm not understanding. Your guess that I want to apply tags to all the resources in my stack that support them (without having to repeat myself for each resource) though is correct |
When I say "during deployment" I mean "resolved by CloudFormation when the stack is deployed". Stack-level tags are specified when the CLI invokes the To achieve what you want, use workaround #3 above. You can just add all the resources into a sub-construct in your stack ( |
Thanks @eladb ! |
🐛 Bug Report
What is the problem?
Specifying
core.Aws.STACK_NAME
as a value to the Stack wide Tags causescdk deploy
to report an error. The same configuration is not reported as erroneous when usingcdk synth
. Tags are supported on all the resources in use (S3, DynamoDB table, and Kinesis stream).Reproduction Steps
Using this file
And then running this command
Verbose Log
Environment
Other information
Generated synth output is
Which boots fine in CloudFormation if you manually upload the template
The text was updated successfully, but these errors were encountered: