Create an access key
Create an access key that S3 clients sign requests with; it acts as an IAM user and its secret is shown once.
An S3 client signs its requests with an access key ID and a secret access key. An IAM access key does this: the same key also works for the Deutsche Cloud API, the CLI and Terraform. A key acts as its IAM user: it can do exactly what that user's IAM policies allow, and no more than its scope when it has one.
Prerequisites
- Permission for
iam:CreateAccessKey. Without it the page says "Creating a key needs iam:CreateAccessKey; ask an administrator." and has no Create access key button. - The principal has fewer active keys than the
iam.access-keysquota allows per user; otherwise the create is refused with409Quota exceeded: Access keys per user (iam.access-keys) — ….
Create the key
- Open Identity, then choose Access keys.
- Choose Create access key.
- (Optional) For Acts as, choose another principal than yourself.
- (Optional) For Description, enter what uses the key.
- (Optional) Under Limited to, choose One bucket or Custom policy (see Limit a key to one bucket); No limit is chosen.
- (Optional) Under Expiry, for Expires after (days), enter how long the key lives. It starts on your organization's default and cannot exceed its maximum.
- Choose Create access key.
- Copy the Key ID and the Secret. This is the only time the secret is shown.
The panel also shows the aws configure set lines for the key under S3 clients (AWS CLI, rclone,
SDKs): access key ID and secret.
dcloud iam access-keys create --description "uploads app"POST /iam/api/access-keys
{ "description": "uploads app" }resource "dcloud_iam_access_key" "uploads" {
description = "uploads app"
}The secret is kept in the Terraform state; protect the state.
Result
The response's accessKeyId (for example EWS1EXAMPLEEXAMPLE00) is the S3 access key ID and its
secretKey the secret access key. The secret is in this response and nowhere else. Every IAM key
expires: by default after your organization's default (90 days unless changed), and expiresAt is
in the response.
The key stops working:
- at once when it is deleted, deactivated or expired (S3 answers
InvalidAccessKeyId, orAccessDenied"This key has expired"); - within 10 seconds when its IAM user is deactivated, the person is removed from the organization
or deletes their account, or the organization is closed (
AccessDenied"The key’s owner may no longer act in this organization").
Last used in the key list shows when it last signed a request.
S3-only keys
POST /s3/api/access-keys (dcloud s3 access-keys create, Terraform dcloud_s3_access_key,
s3:CreateAccessKey) creates a key that works with S3 clients only; its id starts with EWSS3. Its
response contains secretAccessKey and the S3 endpoint; the secret is never shown again. These
keys count against the s3.access-keys quota; temporary credentials do not.
dcloud s3 access-keys create --description "nightly backup job"