CmdID

CmdID / aws / aws cloudfront

aws cloudfront tag-resource

Add tags to a CloudFront resource. AWS CLI reference

1 example 2 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

To tag a CloudFront distribution

The following tag-resource example adds two tags to the specified CloudFront distribution.

aws cloudfront tag-resource --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE --tags 'Items=[{Key=Name,Value="Example name"},{Key=Project,Value="Example project"}]'Identify
--resourceAn ARN of a CloudFront resource.
--tagsA complex type that contains zero or more Tag elements.

Instead of using command line arguments, you can provide the tags in a JSON file, as shown in the following example.

aws cloudfront tag-resource --resource arn:aws:cloudfront::123456789012:distribution/EDFDVBD6EXAMPLE --tags file://tags.jsonIdentify
--resourceAn ARN of a CloudFront resource.
--tagsA complex type that contains zero or more Tag elements.

Contents of tags.json:

{
    "Items": [
        {
            "Key": "Name",
            "Value": "Example name"
        },
        {
            "Key": "Project",
            "Value": "Example project"
        }
    ]
}

This command produces no output.

For more information, see Tag a CloudFront resource in the Amazon CloudFront Developer Guide.

Options

2 in the AWS CLI reference
--resourceAn ARN of a CloudFront resource.
--tagsA complex type that contains zero or more Tag elements.