Error: Resolving CloudFormation Throttling Issue

Troubleshooting Throttling Error in AWS CloudFormation

Question

You are deploying several CloudFormation templates.

Whilst deploying the templates, you are getting the below error. Error Type Sender Code Throttling Message Rate exceeded Which of the following can be done to resolve the issue?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: B.

The error is happening because the create stack API is creating too many resources at the same time.

You can add some delayed requests using a concept called exponential backoff.

Option A is incorrect since you cannot add a pause.

You can add wait or dependency conditions in CloudFormtion.

Option C is incorrect because using a large instance will not help because this is an issue with the number of requests being fired against CloudFormation.

Option D is incorrect because using one larger template will make the situation worse.

For more information on exponential backoff, please visit the following URLs-

https://forums.aws.amazon.com/thread.jspa?threadID=100414 https://docs.aws.amazon.com/general/latest/gr/api-retries.html https://aws.amazon.com/blogs/messaging-and-targeting/how-to-handle-a-throttling-maximum-sending-rate-exceeded-error/

The error message "Throttling - Rate exceeded" indicates that the API calls to AWS are being made too frequently, and AWS is throttling the requests to prevent overload.

To resolve this issue, we need to reduce the rate of API calls. The following are the possible solutions:

A. Adding a pause in the CloudFormation templates is not an effective solution since it will not reduce the rate of API calls. Pausing will just delay the creation of the stack.

B. Exponential backoff is a method used to gradually increase the time delay between subsequent API calls. This will help reduce the rate of API calls and allow AWS to handle the requests more efficiently. Therefore, adding an exponential backoff between the calls to the createStack API is a valid solution to the problem.

C. Using a large instance from where the CloudFormation template is being deployed will not necessarily solve the problem since the issue is not related to the size of the instance. The rate of API calls is the issue here.

D. Combining the stacks into one template and deploying the stack will not necessarily solve the problem since it will not reduce the rate of API calls. Combining the stacks into one template may even make the problem worse by increasing the number of resources that need to be created.

Therefore, the correct answer is B, adding an exponential backoff between the calls to the createStack API. This will help reduce the rate of API calls and allow AWS to handle the requests more efficiently.