Create an IAM user
Create an IAM user for someone who signs in with a user name, or a service account for a program.
Last updated 18 November 2026View as Markdown
People who sign in with their own email address get an IAM user when they join; invite them instead (see Invite a person). Create one yourself for a program, a CI job, or someone who signs in with a user name your organization gives them. Replace alice with the user name.
Prerequisites
- Permission for
iam:CreateUser. - For the console, also
iam:ListUsersto open Users, andiam:GetUserfor the user's page that opens afterwards (it answers 404 without it).
Create the user
- Open Identity, then choose Users.
- Choose Create user.
- For Username, enter alice: lower-case letters, digits, hyphens and underscores, up to 64 characters.
- (Optional) For Display name, enter the name shown in lists.
- For Type, choose User (the default) or Service account.
- Choose Create user. The user's page opens.
dcloud iam users create --username alice --display-name "Alice Example"POST /iam/api/users
{ "username": "alice", "type": "user" }resource "dcloud_iam_user" "alice" {
username = "alice"
type = "user"
}Result
The user exists and holds no permissions. Give it some by attaching a policy, adding it to a group or assigning it a role; see Attach a policy.
| Type | How it signs in |
|---|---|
| User | With an access key, and to the console once you give it a password; see Give a user console access. |
| Service account | With an access key only; see Create an access key. |
The type cannot be changed later. The user name is what the user is called in the audit log and at
the console sign-in. A policy names the user by its id:
rn:ews::org-EXAMPLE1234:iam:user/user-id.
If the user is refused
- 409
An IAM user called "alice" already exists in this organization. - 409
Quota exceeded: …when the organization has as many IAM users as its quota allows; see Quotas. - 400 when the user name breaks the rules above.
Related
Did this page help you?