-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
AwsCdkCli: Error occurred while deploying a stack that reads resource values from SSM in version 2.161.1 #31668
Comments
Are you able to provide minimal reproducible code snippets so we can quickly reproduce that in our environment? And, did you mean this was previously working but broken in 2.161.1? If yes, what is the last known working CDK version? |
Hey mate, it's all because of this commit: To reproduce the issue is quite simple - add this line to any of the stacks:
Our requirement is to add a tag from the SSM Parameter Store to all resources within the stack. Please either resolve this issue or provide an alternative solution to achieve this. |
If you see this error, this is because #31457 fixed a bug and doesn't allow stack tags contain unresolved values. Can you share your minimal code snippets to help us look into your issue? |
To reproduce the issue is quite simple - add this line to any of the stacks: Tags.of(stack).add( To be honest, I understand that the commit is intended to prevent the generation of incorrect tags in the CloudFormation stack, such as "Tokenxxxx." However, I don't understand why it restricts normal usage. I only want to add the tag once at the stack level, rather than needing to add it 100 times for each resource. |
I'm encountering the same error using versions 2.161.0 through 2.162.1 (currently latest) when trying to use a stack parameter in a stack tag. Previously, applying the tag at the stack level like this (using .NET CDK): var stackParameter = new CfnParameter(this, "StackParameter", new CfnParameterProps
{
Description = "Example",
Type = "String",
});
Tags.Of(this).Add("ExampleTag", stackParameter.ValueAsString); would apply it to each resource within the stack like this: {
"Key": "ExampleTag",
"Value": {
"Ref": "StackParameter"
}
}, And the resulting tags had the correct value upon deployment, so I'm not sure why this was considered a bug and is now rejected:
|
@rix0rrr Can you please help on this? |
If there's no plan to fix this issue in short, could you please help to rollback this commit? |
We are encountering the same issue. |
This is an issue for us as well |
IHAC who is facing this issue too and cannot use latest version of CDK. Could you provide an ETA? Thank you :) |
Describe the bug
Our CDK application is breaking. We're trying to add tags to all resources within the CloudFormation template by reading the values from the SSM Parameter Store. However, during deployment with the latest version, we're encountering the following error on the latest version:
Error: Stack tags may not contain deploy-time values (tag: awsApplication=${Token[TOKEN.16]}). Apply tags containing deploy-time values to resources only, avoid tagging stacks.
Our requirement is to add a tag from the SSM Parameter Store to all resources within the stack. Please either resolve this issue or provide an alternative solution to achieve this.
#31457
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
It should work.
Current Behavior
It does not work.
Reproduction Steps
Our requirement is to add a tag from the SSM Parameter Store to all resources within the stack. Please either resolve this issue or provide an alternative solution to achieve this, which doesn't work in version 2.161.1.
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.161.1
Framework Version
No response
Node.js Version
22
OS
MacOS
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: