create-user

Creates a new IAM user for your AWS account.

For information about limitations on the number of IAM users you can create, refer to Limitations on IAM Entities in the IAM User Guide.

Refer to AWS API Documentation.

Refer to AWS help for descriptions of global parameters.

Synopsis

create-user
  [--path <value>]
  --user-name <value>
  [--tags]

Options

--path (string)

The path for the user name. For more information about paths, refer to the IAM Identifiers documentation.

This parameter is optional. If it is not included, it defaults to a slash (/).

This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the “!” (u0021) through the DEL character (u007F), including most punctuation characters, digits, and upper and lowercased letters.

--user-name (string)

The name of the user to create.

IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both “MyResource” and “myresource”.

Note

If any one of the tags is invalid or if you exceed the allowed number of tags per user, then the entire request fails and the user is not created.

--tags (list)

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

Refer to Manage User Tags for more information about tagging.

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.

Refer to AWS help for descriptions of global parameters.

Examples

To create an IAM user

The following create-user command creates an IAM user named Bob in the current account

aws iam create-user --user-name Bob

Output example:

{
    "User": {
        "UserName": "Bob",
        "Path": "/",
        "CreateDate": "2013-06-08T03:20:41.270Z",
        "UserId": "AIDAIOSFODNN7EXAMPLE",
        "Arn": "arn:aws:iam::123456789012:user/Bob"
    }
}

For more information, refer to Adding a New User to Your AWS Account in the Using IAM guide.

Output

User -> (structure)

A structure with details about the new IAM user.

Path -> (string)

The path to the user. For more information about paths, refer to the AWS IAM Identifiers documentation.

UserName -> (string)

The friendly name identifying the user.

UserId -> (string)

The stable and unique string identifying the user. For more information about IDs, refer to the AWS IAM Identifiers documentation.

Arn -> (string)

The Amazon Resource Name (ARN) that identifies the user. For more information about ARNs and how to use ARNs in policies, refer to the AWS IAM Identifiers documentation.

CreateDate -> (timestamp)

The date and time, in ISO 8601 date-time format, when the user was created.

Tags -> (list)

The list of tags that are currently attached to the user. Each tag consists of a key name and an associated value. If no tags are attached to the specified user, the response contains an empty list.

(structure)

A structure that represents user-provided metadata that can be associated with an IAM user. Refer to Manage User Tags for more information about tagging.

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.