Apply the tags - AWS Prescriptive Guidance

Apply the tags

Tags can be implemented by using Tag Editor or AWS CloudFormation, or by activating cost allocation tags. Using Tag Editor, you can create or remove tags on the AWS Management Console. If you’re working on infrastructure as code (using AWS CloudFormation), you can create or remove tags with the same code that you’re using to provision and manage your AWS services. For cost allocation tags, you activate the tags in the Billing and Cost Management console.

Using Tag Editor

You can use Tag Editor to search the resources that you want to tag. Then, you can apply tags for the resources on the console. On the console, choose Services, Management & Governance, Resource Groups & Tag Editor, and then choose Tag Editor.

Tag Editor is a service available in AWS Management Console, but it’s limited in resource coverage. Also, it’s specific to a single account unless you build your own scripts (using AWS CloudFormation, for example).

Using CloudFormation to tag resources

The following example CloudFormation code shows how you can apply tags to AWS resources. In the same script that you would use to launch an EC2 instance, for example, you can include the tag key and value.

Ec2Instance: Type: AWS::EC2::Instance   Properties:     ImageId:       Fn::FindInMap:         - "RegionMap"         - Ref: "AWS::Region"         - "AMI"     Tags:       - Key: "cost-center-id"         Value: "ABC123"

Using cost allocation tags

After you activate cost allocation tags, AWS uses the cost allocation tags to organize your resource costs on your cost allocation report. AWS provides two types of cost allocation tags:

  • AWS generated tags

  • user-defined tags.

For user-defined tags, you can apply tags that represent business categories (such as cost centers, application names, or owners) to organize your costs across multiple services. After you apply tags to your AWS resources and you activate the tags in the Billing and Cost Management console, AWS generates a cost allocation report as a comma-separated values (CSV) file with your usage and costs grouped by your active tags.

Confirm that the tags have the status Active. If not, you need to activate the tags that were created.