You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature request: Propagate tags to SAM translated resources #2642
I would like it if the SAM translator propagated tags from SAM resources to CloudFormation resources. For example, if I have a AWS::Serverless::Function resource in my CFT, the transformed resources such as AWS::CodeDeploy::DeploymentGroup do not contain these tags.
Use Case: We would like to validate tags for SAM templates. We transform the templates before validation, and want to enforce tag validations for the transformed resources.
Proposal
When translating resources from SAM to CloudFormation, save the tags from the SAM resource and apply to all resulting transformed resources that support tagging.
Things to consider:
[ ] The SAM documentation will need to be updated
Thanks for proposing it. There are some questions I can think of that prevent us from doing so:
are tags meant to be propagated?
some resources are generated by SAM from interaction between multiple resources, tags from which origin resource should be propagated?
Are tags meant to be propagated?
Tags are metadata, and it can represent anything. If a tag is very specific and only apply to that single resource, it doesn't make sense to propagate. For example, a tag "arm-ready-lambda-function=yes" on a lambda function should not be propagated to the generated resource such as IAM role or lambda permissions.
Multiple origin resource contributes to a single generated resource.
Imagine the template has an "AWS::Serverless::Api" and "AWS::Serverless::Function" and they both contribute to the generation of a lambda permission. There could be conflict when we propagate both resources' tags to the generated resource.
Activity
aahung commentedon Nov 23, 2022
Thanks for proposing it. There are some questions I can think of that prevent us from doing so:
Are tags meant to be propagated?
Tags are metadata, and it can represent anything. If a tag is very specific and only apply to that single resource, it doesn't make sense to propagate. For example, a tag "arm-ready-lambda-function=yes" on a lambda function should not be propagated to the generated resource such as IAM role or lambda permissions.
Multiple origin resource contributes to a single generated resource.
Imagine the template has an "AWS::Serverless::Api" and "AWS::Serverless::Function" and they both contribute to the generation of a lambda permission. There could be conflict when we propagate both resources' tags to the generated resource.