AWS cloud formation Template- providing Tags for the stack in the template

0 votes

For billing, I want to use company specific Tags to the created resource in AWS. I am using a CloudFormation template to integrate our Elastic beanstalk instance and other project dependent resources. When I use the CloudFormation console to create a stack it asks me for Tags after parameters. I have to manually input the Tags for that stack. However is there a way to specify those Tags (Tags for the stack) within the CloudFormation template itself?  I know that the CloudFormation automatically tags the resources with the stack name. But I need company specific tags to bill separate departments. How to do It can anyone help me?

May 20, 2019 in AWS by Atul
• 10,240 points

retagged May 22, 2019 by Kalgi 2,829 views

1 answer to this question.

0 votes

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"
            }
       ]
    }
}
answered May 20, 2019 by ArchanaNagur
• 2,360 points

Related Questions In AWS

0 votes
1 answer

How to provide tags for the stack in CloudFormation Template?

In the template anatomy, you cant set ...READ MORE

answered Aug 13, 2018 in AWS by bug_seeker
• 15,510 points
19,613 views
0 votes
1 answer

What is the difference between AWS Ops Work and Cloud Formation?

AWS Ops Work is an application management ...READ MORE

answered Dec 14, 2018 in AWS by Shuvodip
1,841 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

What is the difference between an Instance, AMI and Snaphots in AWS?

AMI is the Amazon Machine Image which provides ...READ MORE

answered May 24, 2019 in AWS by ArchanaNagur
• 2,360 points
4,244 views
+1 vote
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP