Tag a distribution
Tags are words or phrases that you can use to identify and organize your AWS resources. You can add multiple tags to each resource, and each tag includes a key and a value that you define. For example, the key might be "domain" and the value might be "example.com". You can search and filter your resources based on the tags you add.
You can use tags with CloudFront, such as the following examples:
-
Enforce tag-based permissions on CloudFront distributions. For more information, see ABAC with CloudFront.
-
Track billing information in different categories. When you apply tags to CloudFront distributions or other AWS resources (such as Amazon EC2 instances or Amazon S3 buckets) and activate the tags, AWS generates a cost allocation report as a comma-separated value (CSV file) with your usage and costs aggregated by your active tags.
You can apply tags that represent business categories (such as cost centers, application names, or owners) to organize your costs across multiple services. For more information about using tags for cost allocation, see Using cost allocation tags in the AWS Billing User Guide.
Notes
-
You can tag distributions, but you can't tag origin access identities or invalidations.
-
Tag Editor and Resource groups aren't currently supported for CloudFront.
-
For the current maximum number of tags that you can add to a distribution, see General quotas.
Tag restrictions
The following basic restrictions apply to tags:
-
For the maximum number of tags per distribution, see General quotas.
-
Maximum key length – 128 Unicode characters
-
Maximum value length – 256 Unicode characters
-
Valid values for key and value – a-z, A-Z, 0-9, space, and the following characters: _ . : / = + - and @
-
Tag keys and values are case sensitive
-
Don't use
aws:
as a prefix for keys. This prefix is reserved for AWS use.
Add, edit, and delete tags for distributions
You can use the CloudFront console to manage tags for your distributions.
To add tags, edit, or delete tags for a distribution
Sign in to the AWS Management Console and open the CloudFront console at https://console.aws.amazon.com/cloudfront/v4/home
. -
Choose the ID for the distribution that you want to update.
-
Choose the Tags tab.
-
Choose Manage tags.
-
On the Manage tags page, you can do the following:
-
To add a tag, enter a key and, optionally, a value for the tag. Choose Add new tag to add more tags.
-
To edit a tag, change the tag’s key or its value, or both. You can delete the value for a tag, but the key is required.
-
To delete a tag, choose Remove.
-
-
Choose Save changes.
Programmatic tagging
You can also use the CloudFront API, AWS Command Line Interface (AWS CLI), AWS SDKs, and AWS Tools for Windows PowerShell to apply tags. For more information, see the following topics:
-
CloudFront API operations:
-
AWS CLI – See cloudfront
in the AWS CLI Command Reference -
AWS SDKs – See the applicable SDK documentation on the AWS Documentation page
-
Tools for Windows PowerShell – See Amazon CloudFront in the AWS Tools for PowerShell Cmdlet Reference