Interview Prep/Real-World Interview/Cloud provider issues

All services that read encrypted S3 objects and secrets fail with "KMSInvalidStateException: arn:aws:kms:...:key/... is pending deletion."

AdvancedTroubleshootingCloud provider issues
Answer

Likely causes → Someone scheduled the customer-managed KMS key for deletion (a cleanup script, or Terraform destroying a resource that owned the key). While pending deletion, the key can't be used, so every decrypt fails. Once the waiting period (7–30 days) ends, the data encrypted with it is gone for good.

Diagnose →

aws kms describe-key --key-id $KEY --query 'KeyMetadata.[KeyState,DeletionDate]'
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=ScheduleKeyDeletion

Fix → Cancel the deletion and re-enable the key right away:

aws kms cancel-key-deletion --key-id $KEY
aws kms enable-key --key-id $KEY

Then remove it from whatever will try to delete it again (Terraform state, cleanup job).

Prevent → Deny kms:ScheduleKeyDeletion for all but a break-glass role via SCP or key policy, alarm on the CloudTrail event, use the 30-day waiting period, and keep prevent_destroy on key resources.

All Real-World Interview questions Roadmap: Interview readiness

More on Cloud provider issues