Aws Tagging Best Practices
Aws Tagging Best Practices
Aws Tagging Best Practices
December, 2018
https://docs.aws.amazon.com/whitepapers/latest/
tagging-best-practices/tagging-best-
practices.html
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Notices
This document is provided for informational purposes only. It represents AWS’s current product
offerings and practices as of the date of issue of this document, which are subject to change without
notice. Customers are responsible for making their own independent assessment of the information in
this document and any use of AWS’s products or services, each of which is provided “as is” without
warranty of any kind, whether express or implied. This document does not create any warranties,
representations, contractual commitments, conditions or assurances from AWS, its affiliates, suppliers
or licensors. The responsibilities and liabilities of AWS to its customers are controlled by AWS
agreements, and this document is not part of, nor does it modify, any agreement between AWS and its
customers.
https://docs.aws.amazon.com/whitepapers/latest/
tagging-best-practices/tagging-best-
practices.html
Contents
Introduction: Tagging Use Cases 1
Conclusion 15
Contributors 15
References 15
Tag Everything 16
For the latest version of this document, visit:
Integrate with Authoritative Data Sources 16
Document Revisions 18
https://docs.aws.amazon.com/whitepapers/latest/
tagging-best-practices/tagging-best-
practices.html
Abstract
Amazon Web Services allows customers to assign metadata to their AWS resources in the form
of tags. Each tag is a simple label consisting of a customer-defined key and an optional value
that can make it easier to manage, search for, and filter resources. Although there are no
inherent types of tags, they enable customers to categorize resources by purpose, owner,
environment, or other criteria.
Without the use of tags, it can become difficult to manage your resources effectively as your
utilization of AWS services grows. However, it is not always evident how to determine what
tags to use and for which types of resources. The goal of this whitepaper is to help you develop
a tagging strategy that enables you to manage your AWS resources more effectively.
https://docs.aws.amazon.com/whitepapers/latest/
tagging-best-practices/tagging-best-
practices.html
Amazon Web Services – Tagging Best Practices
Tags for
https://docs.aws.amazon.com/whitepapers/latest/
tagging-best-practices/tagging-best-
practices.html
Automation
Resource or service-specific tags are often used to filter resources during infrastructure
automation activities. Tags can be used to opt into or out of automated tasks, or to identify
Page 1
Amazon Web Services – Tagging Best Practices
specific versions of resources to archive, update, or delete. For example, many customers run
automated start/stop scripts that turn off development environments during non-business
hours to reduce costs. In this scenario, Amazon Elastic Compute Cloud (Amazon EC2) instance
tags are a simple way to identify the specific development instances to opt into or out of this
process.
The sections that follow identify recommended best practices for developing a comprehensive
tagging strategy.
https://docs.aws.amazon.com/whitepapers/latest/
Best Practicestagging-best-practices/tagging-best-
for Identifying Tag Requirements
practices.html
Page 2
Amazon Web Services – Tagging Best Practices
Rather than meeting with each of these functional areas separately to identify their tagging
needs, conduct tagging requirements workshops with representation from all stakeholder
groups, so that each can hear the perspectives of the others and integrate their requirements
more effectively into the overall strategy.
A consistent approach is warranted even for tags identified as optional. For example, if you
employ an opt-in approach for automatically stopping development environments during non-
working hours, identify a single tag for this purpose rather than allowing different teams or
departments to use their own; resulting in many different tags all serving the same purpose.
This version has been archived.
Assign Owners to Define Tag Value Propositions
Consider tags from a cost/benefit perspective when deciding on a list of required tags. While
Fora fee
AWS does not charge theforlatest version
the use of ofmay
tags, there this document,
be indirect costs (forvisit:
example, the
labor needed to assign and maintain correct tag values for each relevant AWS resource).
To ensure tags are useful identify an owner for each one. The tag owner has the responsibility
https://docs.aws.amazon.com/whitepapers/latest/
to clearly articulate its value proposition. Having tag owners may help avoid unnecessary costs
tagging-best-practices/tagging-best-
related to maintaining tags that are not used.
practices.html
Focus on Required and Conditionally Required Tags
Tags can be required, conditionally required, or optional. Conditionally required tags are only
mandatory under certain circumstances (for example, if an application processes sensitive data,
Page 3
Amazon Web Services – Tagging Best Practices
you may require a tag to identify the corresponding data classification, such as Personally
Identifiable Information or Protected Health Information).
When identifying tagging requirements, focus on required and conditionally required tags.
Allow for optional tags, as long as they conform to your tag naming and governance policies, to
empower your organization to define new tags for unforeseen or bespoke application
requirements.
Tags help you identify sets of resources. Tags can be removed when no longer needed. A new
tag can be applied to a set of resources in bulk, however, you need to identify the resources
requiring the new tag and the value to assign those resources.
Start with a smaller set of tags that are known to be needed and create new tags as the need
arises. This approach is recommended over specifying an overabundance of tags that are
anticipated to be needed in the future.
Page 4
Amazon Web Services – Tagging Best Practices
Consider naming your tags using all lowercase, with hyphens separating words, and a prefix
identifying the organization name or abbreviated name. For example, for a fictitious company
named AnyCompany, you might define tags such as:
The prefix ensures that tags are clearly identified as having been defined by your organization
and not by AWS or a third-party tool that you may be using. Using all lowercase with hyphens
Thisabout
for separators avoids confusion version
how to has been
capitalize a tagarchived.
name. For example,
anycompany:project-id is simpler to remember than ANYCOMPANY:ProjectID,
anycompany:projectID, or Anycompany:ProjectId.
Page 5
Amazon Web Services – Tagging Best Practices
EC2 Instances
Naming for EC2 instances is a good place to start. Most organizations have already recognized
the need to standardize on server hostnames, and have existing practices in effect. For
example, an organization might create hostnames based on several components, such as
physical location, environment type (development, test, production), role/purpose, application
ID, and a unique identifier:
First, note that the various components of a hostname construction process like this are great
candidates for individual AWS tags – if they were important in the past, they’ll likely be
important in the future. Even if these elements are captured as separate, individual tags, it’s
still reasonable to continue to use this style of server naming to maintain consistency, and
substituting a different physical location code to represent AWS or an AWS region.
However, if you’re moving away from treating your virtual instances like pets and more like
cattle (which is recommended), you’ll want to automate the assignment of server names to
avoid having to assign them manually. As an alternative, you could simply use the AWS
instance-id (which is globally unique) for your server names.
This version has been archived.
In either case, if you’re also creating DNS names for servers, it’s a good idea to associate the
value used for the Name tag with the Fully Qualified Domain Name (FQDN) for the EC2
instance. So, if your instance name is phlpwcspweb3, the FQDN for the server could be
For the latest version of this document, visit:
phlpwcspweb3.anycompany.com. If you’d rather use the instance-id for the Name tag, then you
should use that in your FQDN (for example, i-06599a38675.anycompany.com).
https://docs.aws.amazon.com/whitepapers/latest/
Other AWS Resource Types
tagging-best-practices/tagging-best-
For other types of AWS resources, one approach is to adopt a dot notation consisting of the
practices.html
following name components:
Page 6
Amazon Web Services – Tagging Best Practices
3. type suffix: for example, subnet, sg, role, policy, kms-key, etc.
See Table 2 for examples of tag names for other AWS resource types.
Some resource types limit the character set that can be used for the name. In such cases, the
dot characters canFor
be replaced with hyphens.
the latest version of this document, visit:
Page 7
Amazon Web Services – Tagging Best Practices
you have (1) specified them in the Billing and Cost Management Console and (2) tagged
resources with them.
A natural place to identify the cost allocation tags you need is by looking at your current IT
financial reporting practices. Typically, financial reporting covers a variety of dimensions, such
as business unit, cost center, product, geographic area, or department. Aligning cost allocation
tags with these financial reporting dimensions simplifies and streamlines your AWS cost
management.
AWS provides options for consolidated billing by associating payer accounts and linked
accounts. You can also use AWS Organizations to create master accounts with associated
member accounts to take advantage of the additional centralized management and governance
capabilities.
Organizations may design their account structure based on a number of factors including fiscal
isolation, administrative isolation, access isolation, blast radius isolation, engineering, and cost
considerations (refer to the References section for links to relevant articles on AWS Answers).
Examples include:
This version has been archived.
• Creating separate accounts for production and non-production to segregate
communications and access for these environments
•
For the latest version of this document, visit:
Creating a separate account for shared services components and utilities
• Creating a separate audit account to capture log files for security forensics and
monitoring
https://docs.aws.amazon.com/whitepapers/latest/
• Creating separatetagging-best-practices/tagging-best-
accounts for disaster recovery
practices.html
Understand your organization’s account structure when developing your tagging strategy since
alignment of some of the financial reporting dimensions may already be captured by your
account structure.
Page 8
Amazon Web Services – Tagging Best Practices
anycompany:cost-center = 1600|0.25|1625|0.20|1731|0.50|1744|0.05
If designated as a cost allocation tag, such tag values appear in your billing data. However,
there are two challenges with this approach: (1) the data will have to be post-processed to
parse the multi-valued tag values and produce more detailed records, and (2) you will need to
establish a process to accurately set and maintain the tag values.
If possible, consider identifying existing cost sharing or chargeback mechanisms within your
organization—or create new ones—and associate shared AWS resources to individual cost
allocation codes defined by that mechanism.
Tag Everything
When developing a tagging strategy, be wary of focusing only on the set of tags needed for
your EC2 instances. Remember that AWS allows you to tag most types of resources that
generate costs on your billing reports. Apply your cost allocation tags across all resource types
that support tagging to get the most accurate data for your financial analysis and reporting.
Rather than redundantly capturing and maintaining such existing metadata in AWS tags,
consider integrating your CMDB with AWS. The integration can be bi-directional, meaning that
Page 9
Amazon Web Services – Tagging Best Practices
data sourced from the CMDB can be copied to tags on AWS resources, and data that can be
sourced from AWS (for example, IP addresses, instance IDs, and instance types) can be stored
as attributes in your Configuration Items.
If you integrate your CMDB with AWS in this way, extend your AWS tag naming convention to
include an additional prefix to identify tags that have externally-sourced values, for example:
This makes it clear that the tags are provided for convenience, and that the authoritative source
of the data is the CMDB. Referencing authoritative data sources, rather than redundantly
maintaining the same data in multiple systems, is a general data management best practice.
In 2016, the number of tags per resource was increased to 50 (with a few exceptions, such as S3
objects). Because of this, it’s generally recommended to follow good data management practice
For the latest version of this document, visit:
by including only one data attribute per tag.
However, there are some situations where it may make sense to combine several related
attributes together. Some examples include:
https://docs.aws.amazon.com/whitepapers/latest/
tagging-best-practices/tagging-best-
1. For contact information, as shown in Table 3.
practices.html
Page 10
Amazon Web Services – Tagging Best Practices
anycompany:business-contact = John
Smith;john.smith@anycompany.com;+12015551212
Compound Tag Values
anycompany:technical-contact = Susan
Jones;sue.jones@anycompany.com;+12015551213
anycompany:business-contact-email = john.smith@anycompany.com
anycompany:business-contact-phone = +12015551212
Single Tag Values
anycompany:technical-contact-name = Susan Jones
anycompany:technical-contact-email = sue.jones@anycompany.com
anycompany:technical-contact-phone = +12015551213
2. For multi-valued tags where a single attribute can have several homogenous values. For
example, a resource supporting multiple applications might use a pipe-delimited list:
anycompany:cmdb:application-ids = APP012|APP045|APP320|APP450
However, before introducing multi-valued tags, consider the source of the information,
and how the information will be used if captured in an AWS tag. If there is an
authoritative sourceThis version
for the has been
data in question, archived.
then any processes requiring the
information may be better served by referencing the authoritative source directly,
rather than a tag. Also, as recommended in this paper, avoid multi-valued cost
Forif the
allocation tags latest version of this document, visit:
possible.
3. For tags used for automation purposes. Such tags typically capture opt-in and
automation status information. For example, if you implement an AWS Lambda function
https://docs.aws.amazon.com/whitepapers/latest/
to automatically back up EBS volumes by taking snapshots, you might use a tag that
tagging-best-practices/tagging-best-
contains a short JSON document:
practices.html
anycompany:auto-snapshot = { “frequency”: “daily”, “last-backup”:
“2018-04-19T21:18:00.000+0000” }
Page 11
Amazon Web Services – Tagging Best Practices
There are many automation solutions available at AWS Labs (https://github.com/awslabs) and
the AWS Marketplace (https://aws.amazon.com/marketplace) that make use of compound tag
values in their implementations.
AWS CloudFormation provides a common language for provisioning all the infrastructure
resources in your cloud environment. CloudFormation templates are simple text files that
create AWS resources in an automated and secure manner. When you create AWS resources
using AWS CloudFormation templates, you can use the CloudFormation Resource Tags property
to apply tags to certain resource types upon creation.
AWS Service Catalog allows organizations to create and manage catalogs of IT services that are
approved for use on AWS. These IT services can include everything from virtual machine
images, servers, software, and databases to complete multi-tier application environments. AWS
Service Catalog enables a self-service capability for users, allowing them to provision the
services they need while also helping you to maintain consistent governance – including the
application of required tags and tag values.
AWS Identity and Access Management (IAM) enables you to manage access to AWS services
and resources securely. Using IAM, you can create and manage AWS users and groups, and use
permissions to allow or deny their access to AWS resources. When you create IAM policies, you
This version has been archived.
can specify resource-level permissions, which include specific permissions for creating and
deleting tags. In addition, you can include condition keys, such as aws:RequestTag and
aws:TagKeys, which will prevent resources from being created if specific tags or tag values are
not present. For the latest version of this document, visit:
One way to reduce human error is by using AWS Service Catalog. One of the key features of
AWS Service Catalog is TagOption libraries. With TagOption libraries, you can specify required
tags as well as their range of allowable values. AWS Service Catalog organizes your approved
Page 12
Amazon Web Services – Tagging Best Practices
AWS service offerings, or products, into multiple portfolios. You can use TagOption libraries at
the portfolio level, or even at the individual product level, to specify the range of allowable
values for each tag.
For consistency, best practice is to propagate tags and tag values across related resources. If
resources are created by AWS CloudFormation templates, they are created together in groups
called stacks from a common automation script, which can be configured to set tag values
across all resources in the stack. For resources not created via AWS CloudFormation, you can
still implement automation to automatically propagate tags from related resources. For
example, when EBS snapshots are created, you can copy any tags present on the EBS volume to
the snapshot. Similarly, you can use CloudWatch Events to trigger a Lambda function to copy
tags from an S3 bucket to objects within the bucket any time S3 objects are created.
Page 13
Amazon Web Services – Tagging Best Practices
Tag Editor is a feature of the AWS Management Console that allows you to search for resources
using a variety of search criteria and add, modify, or delete tags in bulk. Search criteria can
include resources with or without the presence of a particular tag or value. The AWS Resource
Tagging API allows you to perform these same functions programmatically.
AWS Config enables you to assess, audit, and evaluate the configurations of your AWS
resources. AWS Config continuously monitors and records your AWS resource configurations
and allows you to automate the evaluation of recorded configurations against optimal
configurations. With AWS Config, you can create rules to check resources for required tags and
it will continuously monitor your resources against those rules. Any non-compliant resources
are identified on the AWS Config Dashboard and via notifications. In the case where resources
are initially tagged properly but their tags are subsequently changed or deleted, AWS Config
will find them for you.
You can use AWS Config with CloudWatch Events to trigger automated responses to missing or
incorrect tags. An extreme example would be to automatically stop or quarantine non-
compliant EC2 instances. This version has been archived.
The most suitable governance approach for an organization primarily depends on its AWS
maturity model, but even experienced organizations use a combination of proactive and
For
reactive governance the latest version of this document, visit:
techniques.
Page 14
Amazon Web Services – Tagging Best Practices
Conclusion
AWS resource tags can be used for a wide variety of purposes, from implementing a cost
allocation process to supporting automation or authorizing access to AWS resources.
Implementing a tagging strategy can be challenging for some organizations, due to the number
of stakeholder groups involved and considerations such as data sourcing and tag governance.
This white paper recommends a way forward based on a set of best practices, to get you
started quickly with a tagging strategy that you can adapt as your organization’s needs evolve
over time.
Contributors
The following individuals and organizations contributed to this document:
References
For the latest version of this document, visit:
Tagging Use Cases
• AWS Tagging Strategies
•
https://docs.aws.amazon.com/whitepapers/latest/
Tagging Your Amazon EC2 Resources
tagging-best-practices/tagging-best-
• Centralized multi-account and multi-Region patching with AWS Systems Manager
practices.html
Automation
Page 15
Amazon Web Services – Tagging Best Practices
Tag Everything
User-Defined Cost Allocation Tags
Page 16
Amazon Web Services – Tagging Best Practices
Page 17
Amazon Web Services – Tagging Best Practices
Document Revisions
Date Description
https://docs.aws.amazon.com/whitepapers/latest/
tagging-best-practices/tagging-best-
practices.html
Page 18