Tagging your Amazon CloudWatch resources - Amazon CloudWatch
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Tagging your Amazon CloudWatch resources

A tag is a custom attribute label that you or Amazon assigns to an Amazon resource. Each tag has two parts:

  • A tag key (for example, CostCenter, Environment, or Project). Tag keys are case sensitive.

  • An optional field known as a tag value (for example, 111122223333 or Production). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive.

Tags help you do the following:

  • Identify and organize your Amazon resources. Many Amazon services support tagging, so you can assign the same tag to resources from different services to indicate that the resources are related. For example, you can assign the same tag to a CloudWatch rule that you assign to an EC2 instance.

The following sections provide more information about tags for CloudWatch.

Supported resources in CloudWatch

The following resources in CloudWatch support tagging:

  • Alarms – You can tag alarms using the tag-resource Amazon CLI command and the TagResource API. You can also view and manage your alarm tags using the Alarms details page in the CloudWatch console.

  • Canaries – You can tag canaries using the CloudWatch console. For more information, see Creating a canary.

  • Contributor Insights rules – You can tag Contributor Insights rules when you create them by using the put-insight-rule Amazon CLI command and the PutInsightRule API. You can add tags to existing rules by using the tag-resource Amazon CLI command and the TagResource API.

  • Metric streams – You can tag metric streams when you create them by using the put-metric-stream Amazon CLI command and the PutMetricStream API. You can add tags to existing metric streams by using the tag-resource Amazon CLI command and the TagResource API.

For information about adding and managing tags, see Managing tags.

Managing tags

Tags consist of the Key and Value properties on a resource. You can use the CloudWatch console, the Amazon CLI, or the CloudWatch API to add, edit, or delete the values for these properties. For information about working with tags, see the following:

Tag naming and usage conventions

The following basic naming and usage conventions apply to using tags with CloudWatch resources:

  • Each resource can have a maximum of 50 tags.

  • For each resource, each tag key must be unique, and each tag key can have only one value.

  • The maximum tag key length is 128 Unicode characters in UTF-8.

  • The maximum tag value length is 256 Unicode characters in UTF-8.

  • Allowed characters are letters, numbers, spaces representable in UTF-8, and the following characters: . : + = @ _ / - (hyphen).

  • Tag keys and values are case sensitive. As a best practice, decide on a strategy for capitalizing tags and consistently implement that strategy across all resource types. For example, decide whether to use Costcenter, costcenter, or CostCenter and use the same convention for all tags. Avoid using similar tags with inconsistent case treatment.

  • The aws: prefix is prohibited for tags because it's reserved for Amazon use. You can't edit or delete tag keys or values with this prefix. Tags with this prefix don't count against your tags per resource limit.