Skip to content

Feature request: Propagate tags to SAM translated resources #2642

Closed

Description

@abbylane

Describe your idea/feature/enhancement

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

Additional Details

Activity

  1. added
    stage/needs-triage
    on Nov 22, 2022
  2. aahung commented on Nov 23, 2022

    @aahung
    Contributor

    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.

  3. removed
    stage/needs-triage
    on Nov 23, 2022
  4. locked and limited conversation to collaborators on Nov 25, 2022
  5. converted this issue into a discussion #2664 on Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions