-
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non blocking: Seems weird to add first and validate later, I would flip this around
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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