Troubleshooting AWS KMS Errors
This lesson explains how KMS errors surface in many services, and how a systematic check of the key and its policies resolves most cases.
Learning outcomes
After completing this lesson, you will be able to:
- Recognise common KMS errors and their fixes.
- Follow a checking sequence with CloudTrail.
- Fix instances that terminate at launch because of key permissions.
Common errors
The following table lists the KMS problems most often seen in operations and their fixes.
| Symptom | Cause | Fix |
|---|---|---|
| AccessDeniedException calling kms:Decrypt | Key policy does not allow the principal or account, or IAM policy lacks permission | Add the principal to the key policy and/or IAM policy |
| KMSInvalidStateException / key is disabled | Key disabled or pending deletion | Enable the key or cancel deletion |
| Instance terminates immediately at launch (Client.InternalError) | Encrypted volume and the launching principal or service-linked role cannot use the key | Grant the role access in the key policy |
| Cannot share a snapshot or AMI | Encrypted with an AWS managed key | Copy with a customer managed key, then share |
| Cross-Region copy fails | Destination key not specified or not usable | Specify a key in the destination Region |
| ThrottlingException from KMS | Request rate quota exceeded (for example SSE-KMS on a busy bucket) | Enable S3 Bucket Keys, cache data keys, request a quota increase |
| Service cannot publish to encrypted SNS/SQS | Key policy does not allow the service principal | Allow the service principal kms:GenerateDataKey* and kms:Decrypt |
The following diagram shows a common access denied error: a service-linked role missing from the key policy.

KMS errors
A checking sequence
When a KMS-related failure occurs, check the following points in order.
-
Key, Region and account
Which key is used, and where? Keys are Regional; aliases are per account and Region.
-
Key state
Is it Enabled, Disabled, PendingDeletion or PendingImport?
-
Key policy
Does it allow the calling principal or its account (with the root statement enabling IAM)?
-
IAM, SCPs and boundaries
Does the principal's IAM policy allow the KMS action, and do SCPs or permissions boundaries deny it?
-
Conditions
Do conditions such as kms:ViaService, kms:CallerAccount or encryption context match the request?
-
Service integrations
Is the service principal or service-linked role allowed, and does a grant exist?
CloudTrail records every KMS API call, including failed ones with the error code, which identifies the exact principal and operation.
The following diagram shows the checks as a sequence.

Auto Scaling launches fail after encryption
After a launch template is changed to encrypt volumes with a new customer managed key, the Auto Scaling group's activity history shows Instance became unhealthy while waiting for instance to be in InService state. Termination reason: Client.InternalError: Client error on launch. The key policy allows only the security team. Auto Scaling launches instances with its service-linked role, AWSServiceRoleForAutoScaling, which needs permission to use the key and to create grants. Adding a key policy statement for that role with kms:Encrypt, kms:Decrypt, kms:ReEncrypt*, kms:GenerateDataKey*, kms:DescribeKey and kms:CreateGrant (with kms:GrantIsForAWSResource) fixes the launches.
A service publishes to an encrypted SQS queue and fails. What does the key policy need?
Show answer
A statement allowing that service principal to use the key.
Exam Tips
Remember for the exam
- Check key Region, state, key policy, IAM policy, SCPs and conditions in that order.
- Auto Scaling needs its service-linked role allowed in the key policy for encrypted launches.
- Services publishing to encrypted SNS or SQS need the key policy to allow their service principal.
- KMS throttling on S3: enable Bucket Keys.