aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.1k stars 53 forks source link

[Enhancement] - Centrally manage CloudFormation tags in the Stack #2064

Open kirtan227 opened 3 weeks ago

kirtan227 commented 3 weeks ago

Name of the resource

Other

Resource name

No response

Description

Requesting a feature where CloudFormation manages a tags centrally in a stack. Essentially a default tag section in template where it can be passed once to resource as opposed to defining the tags separately on each resources. Similar feature in terraform like default_tags [1]

Reference: [1] Default Tags https://developer.hashicorp.com/terraform/tutorials/aws/aws-default-tags

Other Details

No response

r-heimann commented 2 weeks ago

I believe this already exists and is called "Stack-Level Tags": https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html

You pretty much define a tag while creating the stack and it will be added to every single resource inside the CloudFormation stack. You can check this in the CloudFormation GUI once you started to create a stack.

Be aware that AWS (or the Service Teams) likes to forget about tag support in CloudFormation, so this doesn't work for every resource (AWS::Events::Rule, AWS::EC2::VPCEndpoint, AWS::ElasticLoadBalancingV2::Listener...)

jk2l commented 1 week ago

if you use AWS CDK, tagging a stack automatically copy those tags to each child resource under the stack