Table Of Contents


User Guide

First time using the AWS CLI? See the User Guide for help getting started.

[ aws . cloudtrail ]



Adds one or more tags to a trail, up to a limit of 50. Tags must be unique per trail. Overwrites an existing tag's value when a new value is specified for an existing tag key. If you specify a key without a value, the tag will be created with the specified key and a value of null. You can tag a trail that applies to all regions only from the region in which the trail was created (that is, from its home region).

See also: AWS API Documentation

See 'aws help' for descriptions of global parameters.


--resource-id <value>
[--tags-list <value>]
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]


--resource-id (string)

Specifies the ARN of the trail to which one or more tags will be added. The format of a trail ARN is:


--tags-list (list)

Contains a list of CloudTrail tags, up to a limit of 50

Shorthand Syntax:

Key=string,Value=string ...

JSON Syntax:

    "Key": "string",
    "Value": "string"

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See 'aws help' for descriptions of global parameters.


To add tags to trail

The following add-tags command adds tags for Trail1:

aws cloudtrail add-tags --resource-id arn:aws:cloudtrail:us-east-1:123456789012:trail/Trail1 --tags-list Key=name,Value=Alice Key=location,Value=us