tag-user

Adds one or more tags to the specified IAM user.

Refer to AWS help for more information.

Note

The requester must have iam:TagUser permissions on the target users.

Synopsis

tag-user
  --user-name <value>
  --tags <value>

Options

--user-name (string)

The name of the IAM user to which you want to add tags.

This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _, +, =, ,, ., @, and -.

--tags (list)

The list of tags to attach to the IAM user. Each tag consists of a key name and an associated value.

Key -> (string) The key name that can be used to look up or retrieve the associated value, such as Department or Cost Center.

Value -> (string) The value associated with this tag. For example, tags with a key name of Department could have values such as Human Resources or Accounting. Typically, many resources have tags with the same key name but different values.

Examples

To add tags to an IAM user

The following tag-user command adds a tag with the associated Department and Cost Center to the IAM user named Alice.

aws iam tag-user --user-name Alice --tags '[{"Key": "Department", "Value": "Accounting"}, {"Key": "Cost Center", "Value": "005"}]'

Output

None