AWS CloudFormation automates and simplifies the task of repeatedly and predictably creating groups of related resources that power your applications. So, while launching AWS CloudFormation, the required tags are applied to stack and are also propagated to the resources launched by the Stack.
There are four tagging categories: Technical, Automation, Business and Security
1)Technical tag contains:
Name : Identify resource.
Application ID: Used to identify resource for an application
Application Role: Describe function of resource. E.g. Web Server, App Server, etc.
Cluster: Basically tells a configuration being shred across a network
Environment: Distinguish DEV, TEST and PROD environment
Version: Tells application version
2) Automation tag contains:
Date/Time : Identify when application needs to be started, stopped and deleted
Opt in/out: Identify whether this needs to be included during automation of activities like start, stop
Security: Describe what security feature is required
3) Business tag contains:
Owner: Identify the owner of resource
Cost center: Identify the business unit
Customer: Describe who is target client
Project: Identify which project supports this resource
4) Security tag contains:
Confidentiality : Identify specific data confidentially being supported for resources
Compliance : Specifies what compliance is required for this resource
Even if you want to include tag only for specific resources than this can also be done. For this while launching Amazon EC2 instances, tags should be included in the template:
Example:
"MyInstance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"SecurityGroups" : [ { "Ref" : "MySecurityGroup" } ],
"AvailabilityZone" : "us-west-2",
"ImageId" : " ami-0756fbca465a59a30",
"Volumes" : [
{ "VolumeId" : { "Ref" : "MyEBS" },
"Device" : "/test/sdk" }
],
"Tags" : [
{
"Key" : "Phase",
"Value" : "testing"
}
]
}
}