Under load, S3 and SSM calls start failing with `ThrottlingException: You have exceeded the rate at which you may call KMS. Reduce the frequency of your calls.`
AdvancedTroubleshootingCloudFormation, CloudWatch, KMS, Secrets and Cost
Answer
Likely causes → Every SSE-KMS object read or write, every SecureString parameter read and every envelope encryption call hits KMS, and they share a per-account, per-Region request quota for cryptographic operations (thousands of requests per second, depending on the Region).
Diagnose →
aws service-quotas list-service-quotas --service-code kms \
--query "Quotas[?contains(QuotaName,'Cryptographic operations')].[QuotaName,Value]"
# CloudWatch AWS/Usage: Service=KMS, Type=API, Resource=Decrypt/GenerateDataKey
aws s3api get-bucket-encryption --bucket data --query 'ServerSideEncryptionConfiguration.Rules[].BucketKeyEnabled'
Fix →
- Turn on S3 Bucket Keys, which cut KMS calls from S3 by up to 99%:
aws s3api put-bucket-encryption --bucket data --server-side-encryption-configuration '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"aws:kms","KMSMasterKeyID":"<key>"},"BucketKeyEnabled":true}]}' - Cache decrypted secrets and parameters in the app (Secrets Manager caching client, Parameters and Secrets Lambda extension)
- Use data key caching (AWS Encryption SDK)
- Request a quota increase
Prevent → Alarm on KMS usage at 70% of the quota, and design for caching from the start.
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