- Newest
- Most votes
- Most comments
Based on the errors you're experiencing, you're encountering two distinct issues with your CloudFront distribution updates via CloudFormation:
ServiceUnavailableException ("An unknown error occurred"): This indicates a temporary service issue on the AWS side. This type of error typically suggests that the CloudFront service is experiencing problems processing your request.
ThrottlingException ("Rate exceeded"): This error indicates you're hitting CloudFront API rate limits. CloudFront has throttling limits on distribution update operations, and when you exceed these limits, subsequent requests are rejected.
Recommended Resolution Steps:
-
Implement Exponential Backoff: Since you're hitting rate limits, implement a retry strategy with exponential backoff in your deployment process. Space out your CloudFormation stack update attempts rather than retrying immediately.
-
Check for Multiple Concurrent Updates: Ensure you're not attempting multiple simultaneous updates to the same CloudFront distribution. CloudFront only allows one update operation at a time per distribution.
-
Verify Lambda@Edge Function Version: When updating Lambda@Edge associations, ensure you're specifying a specific function version ARN, not an alias or $LATEST. The Lambda function must be published as a numbered version.
-
Wait Between Deployment Attempts: Given that all your UpdateDistribution calls are failing, wait for a longer period (several hours) before attempting another deployment to allow any rate limiting to reset.
-
Contact AWS Support: Since this is affecting all your update attempts and started suddenly on March 31st without any changes on your end, this may indicate an account-level issue or a service problem. AWS Support can investigate whether there are any account-specific throttling issues or service problems affecting your distribution.
-
Consider Temporary Workaround: If urgent, you might need to create a new CloudFront distribution with the updated Lambda@Edge function as a temporary workaround while the issue is being resolved.
The combination of both ServiceUnavailableException and ThrottlingException errors suggests this may be related to either an AWS service issue or an account-level throttling problem that requires AWS Support intervention to resolve.
Sources
AWS::CloudFront::Distribution LambdaFunctionAssociation - AWS CloudFormation
I have rarely seen that when you upgrade a Lambda function, it might need more CPU/RAM. If that's your case, you will need to upgrade the memory on your Lambda to be able to cope.
Relevant content
- asked 4 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 10 months ago
