fix(stack): check stack tags for deploy-time values#31457
Conversation
Stack tags are not rendered to the template, but instead are passed via API call. Verify that stack tags do not contain unresolved values, as they won't work. Closes #28017.
| stack.node.addMetadata(cxschema.ArtifactMetadataEntryType.STACK_TAGS, stack.tags.renderTags()); | ||
| if (Object.entries(stackTags).length > 0) { | ||
| stack.node.addMetadata( | ||
| cxschema.ArtifactMetadataEntryType.STACK_TAGS, |
There was a problem hiding this comment.
non blocking: Seems weird to add first and validate later, I would flip this around
There was a problem hiding this comment.
An exception is an exception, no? :)
|
Added |
| if (Object.entries(stackTags).length > 0) { | ||
| stack.node.addMetadata( | ||
| cxschema.ArtifactMetadataEntryType.STACK_TAGS, | ||
| Object.entries(stackTags).map(([key, value]) => ({ Key: key, Value: value }))); |
There was a problem hiding this comment.
We used to use renderTags and not tagValues here. I think those are the same if we disallow tokens, but wanted to pause on that for a second. Can you elaborate/explain why this is safe?
Its also weird we used to pass renderTags here but tagValues in the artifact itself.
There was a problem hiding this comment.
The fact that we used to use 2 different invocations is exactly the reason why I changed this here.
We know what formats are expected here, so we should do the rendering here, not defer it to some other class that might also be used in different contexts.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Stack tags are not rendered to the template, but instead are passed via API call.
Verify that stack tags do not contain unresolved values, as they won't work.
Closes #28017.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license