Create an access key

Create a credential that acts as an IAM user outside the browser, for the API, the CLI, Terraform, the container registry, git over HTTPS and S3 clients.

Last updated 19 November 2026View as Markdown

An access key is a pair: a key ID of 20 characters that starts with EWS1, and a secret of 40 characters. The key acts as one IAM user or service account and can do what that account's policies allow. For a script, create a service account with exactly the policies it needs and a key for it. For a key that reaches one bucket, or a temporary key narrower than yourself, see Give access to one bucket. Replace ci-deploy with what the key is for.

Prerequisites

  • Permission for iam:CreateAccessKey. Without it the console says "Creating a key needs iam:CreateAccessKey; ask an administrator." and shows no Create access key button.
  • In the console, also iam:ListAccessKeys: without it the Access keys page shows only "You do not have permission to list access keys."
  • The IAM user the key acts as is active, and has fewer active, unexpired keys than the iam.access-keys quota allows per user (see Quotas).

Create the key

  1. Open Identity, then choose Access keys.
  2. Choose Create access key.
  3. (Optional) For Acts as, choose the IAM user the key acts as. It starts on you.
  4. (Optional) For Description, enter ci-deploy.
  5. (Optional) Open Expiry and, for Expires after (days), enter the key's lifetime. It starts on your organization's default and cannot exceed its maximum.
  6. Choose Create access key.
  7. Copy the Key ID and the Secret, then choose I've saved the secret, dismiss.

Result

The secret is in the create response and on the console panel, and nowhere else: it cannot be read again. With Terraform it is kept in the state, so protect the state as you would the key.

Use the pair as:

Authorization: EWS-ACCESS-KEY EWS1EXAMPLEEXAMPLE00:<secret>

The panel shows the same pair as a docker login line for the container registry (the same pair works for git over HTTPS), as dcloud auth login --with-key for the CLI, and as aws configure set lines for S3 clients.

  • Expiry. Every new key expires. Without expiresInDays it gets the organization's default (90 days unless changed); a request may ask for 1 day up to the organization's maximum (365 days unless changed).
  • No limit on the key. What the key may do is its account's policies. The scopePolicy field (--scope-policy, Terraform scope_policy) is deprecated: it is still accepted and enforced, and the response then carries a deprecation note. Give the account the policy it needs, or use a temporary key, instead. Keys made earlier with a limit keep it; Access keys lists them under Legacy limited keys, where Migrate replaces each (see Keys with a limit).
  • Acting as another person. A key for another person's own IAM user records everything done with it as that person. The console asks you to select I create a key that acts as …; the API needs "actAsMember": true. The audit log names you as the creator.

If the key is refused

  • 400 expiresInDays is 400; this organization allows at most 365 days.
  • 400 This key would act as …, a person in this organization: … when actAsMember is missing.
  • 400 scopePolicy: … when the deprecated scopePolicy is not a valid policy document.
  • 404 IAM user not found for an iamUserId outside your organization.
  • 409 … is suspended (for example a former member) and cannot be given new access keys.
  • 409 Quota exceeded: Access keys per user (iam.access-keys) — … when the user has as many active keys as allowed. Deactivate or delete one first (see Manage access keys).
Did this page help you?