CloudConsole

KMS AccessDeniedException when reading an encrypted S3 object or secret

Updated 17 November 2026 · How we write and check guides

Short answer

The data is encrypted with a customer managed KMS key and the caller isn't allowed to use that key, even though S3 or Secrets Manager itself would allow the read. KMS checks the key policy first: unless it allows the caller directly, or delegates to IAM with a statement for the account, IAM permissions alone don't count. Grant kms:Decrypt (and kms:GenerateDataKey for writes) on the key ARN in both the key policy and, where needed, the caller's IAM policy.

Find the key and fix it, in 4 steps: 1. Identify the key protecting the data:; 2. Read its policy:; 3. Grant the caller; 4.…
The diagnosis and fix steps from this page, in the order to try them; commands and details are below.

What you see

The service calls KMS on your behalf, so the KMS denial appears inside another service's error:

An error occurred (AccessDenied) when calling the GetObject operation:
User: arn:aws:sts::123456789012:assumed-role/reports-reader/i-0123456789abcdef0 is not authorized
to perform: kms:Decrypt on resource: arn:aws:kms:eu-west-2:123456789012:key/1a2b3c4d-…
because no identity-based policy allows the kms:Decrypt action

An error occurred (AccessDeniedException) when calling the GetSecretValue operation:
Access to KMS is not allowed

The tell-tale sign in S3 is that unencrypted (or SSE-S3) objects in the same bucket read fine while some objects fail. In Secrets Manager, DescribeSecret works but GetSecretValue fails.

How KMS decides

Every KMS key has a key policy, and it's the primary control. IAM policies only apply if the key policy delegates to the account, usually through a statement allowing arn:aws:iam::123456789012:root to perform kms:*. So:

SituationWhat must allow the caller
Same account, key policy delegates to IAMAn IAM policy granting kms:Decrypt on the key ARN
Same account, key policy doesn't delegateThe key policy itself must name the role
Cross-accountBoth the key policy (naming the other account or role) and the caller's IAM policy
AWS managed key (aws/s3, aws/secretsmanager)Can't be shared cross-account; its policy can't be edited. Re-encrypt with a customer managed key

Watch for conditions too: kms:ViaService limits use to calls coming through a particular service (for example s3.eu-west-2.amazonaws.com), and kms:EncryptionContext conditions must match what the service sends.

Find the key and fix it

  1. Identify the key protecting the data:
    aws s3api head-object --bucket reports-bucket --key 2026/11/summary.csv \
      --query SSEKMSKeyId --output text
    aws secretsmanager describe-secret --secret-id prod/db --query KmsKeyId --output text
  2. Read its policy:
    aws kms get-key-policy --key-id arn:aws:kms:eu-west-2:123456789012:key/1a2b3c4d-… \
      --policy-name default --query Policy --output text | jq .
  3. Grant the caller. In the IAM policy (same account with delegation, or cross-account):
    { "Effect": "Allow",
      "Action": ["kms:Decrypt"],
      "Resource": "arn:aws:kms:eu-west-2:123456789012:key/1a2b3c4d-…" }
    For uploads to an SSE-KMS bucket, add kms:GenerateDataKey; multipart uploads need kms:Decrypt as well.
  4. For cross-account access, add a key policy statement naming the other account's role, then retry.

Other KMS failures that look similar

  • DisabledException or KMSInvalidStateException: the key is disabled or scheduled for deletion. Re-enable it or cancel deletion with aws kms cancel-key-deletion while you still can.
  • NotFoundException for a key alias: the alias is in another region or account. Use the full key ARN.
  • Lambda and ECS failing to read encrypted environment variables or secrets at start-up: the execution role, not the function's code identity, needs kms:Decrypt.

Avoid granting kms:* on *. Scope to the specific key ARN and to Decrypt (read) or GenerateDataKey (write).

Questions

Why can I read some S3 objects but not others in the same bucket?

The failing objects are encrypted with an SSE-KMS key that your role can't use. Check SSEKMSKeyId with head-object and grant kms:Decrypt on that key.

What does Access to KMS is not allowed mean in Secrets Manager?

Secrets Manager couldn't decrypt the secret because the caller lacks kms:Decrypt on the secret's KMS key, or the key policy doesn't allow it.

Can I share an aws/s3 managed key with another account?

No. AWS managed keys can only be used within their own account. Use a customer managed key and allow the other account in its key policy.

CloudConsole access check screen on a phone, for following up on KMS AccessDeniedException when reading an encrypted S3…
When this happens away from your desk

KMS denials often break a service at start-up after a key or role change, so the first sign is tasks or functions failing to start. CloudConsole, a phone app for AWS, is built to show those alarms and start-up logs on your phone.

Did it start after a deploy? What changed? on the app’s alarm screen lists the deploys and configuration changes from the hour before the alarm fired.

About the app → · Download on the App Store

Sources