-
Notifications
You must be signed in to change notification settings - Fork 11
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
(annotations): annotations that include tokens are output as [object Object] #116
Comments
I think the fix would be to use Token.isUnresolved() to detect if the string contains any Tokens, and if it does, use Token.asString() to ensure proper resolution at synthesis time. e.g. private addMessage(level: string, message: string | IResolvable) {
const isNew = !this.scope.node.metadata.find((x) => x.data === message);
if (isNew) {
// If message already implements IResolvable (like a Token), or is a string containing tokens,
// we want to preserve its resolvable nature rather than prematurely converting to string
const normalizedMessage = Token.isUnresolved(message) ? Token.asString(message) : message;
this.scope.node.addMetadata(level, normalizedMessage, { stackTrace: this.stackTraces });
}
} Making it a p1 and requesting inputs from the team. |
Even with However, in that case, the tokens are also output to manifest.json of the cloud assembly. The tokens are for CDK apps, but the cloud assembly is for CFn or CDK CLI. Therefore, the cloud assembly should be output with the token resolved. (It already contains strings in other CFn formats such as So I submitted a PR to the CDK CLI repository without modifying the aws-cdk-lib. Because I thought that was the best way to fix just the message output part without changing the manifest format. Please see the details: #101 |
Describe the bug
If a stack with name 'some-stack' includes an info annotation
then the following output results:
Regression Issue
Last Known Working CDK Version
No response
Expected Behavior
The string representation of the token should be output.
Current Behavior
The message is output as "[object Object]"
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.1000.2 (build bc82193)
Framework Version
No response
Node.js Version
v22.12.0
OS
Ubuntu
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: