Decrypt calls fail with `KMSInvalidStateException: arn:aws:kms:...:key/... is pending deletion.`
IntermediateTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer
Likely causes → Someone scheduled the key for deletion (7–30 day waiting period). While pending, the key cannot be used, and everything encrypted with it stops working.
Diagnose →
aws kms describe-key --key-id <key-id> --query 'KeyMetadata.[KeyState,DeletionDate]'
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=ScheduleKeyDeletion --max-results 5
Fix →
aws kms cancel-key-deletion --key-id <key-id>
aws kms enable-key --key-id <key-id> # cancel leaves it Disabled
Prevent → Deny kms:ScheduleKeyDeletion through SCP except for a break-glass role, alarm on that CloudTrail event through EventBridge, and use the 30-day window.
More on CloudFormation, CloudWatch, KMS, Secrets and Cost
Updating a stack fails: `Stack:arn:aws:cloudformation:...:stack/app/... is in ROLLBACK_COMPLETE state and can not be updated.`BeginnerA stack is stuck in `UPDATE_ROLLBACK_FAILED`.AdvancedA pipeline fails with `An error occurred (ValidationError) when calling the UpdateStack operation: No updates are to be performed.`Beginner`InsufficientCapabilitiesException: Requires capabilities : [CAPABILITY_NAMED_IAM]`.BeginnerStack deletion ends in `DELETE_FAILED` with `The bucket you tried to delete is not empty` on an S3 bucket resource.IntermediateDrift detection shows `MODIFIED` on a security group and an RDS instance that someone changed in the console. How do you reconcile?Advanced