Adding retries to your application - AWS Secrets Manager

Adding retries to your application

Your AWS client might see calls to Secrets Manager fail due to unexpected issues on the client side. Or calls might fail due to rate limiting from the Secrets Manager resource you attempt to invoke. When you exceed an API request quota, Secrets Manager throttles the request, that is, it rejects an otherwise valid request and returns a ThrottlingException error. To respond, use a backoff and retry strategy.In either case, these kinds of failures often don’t require special handling and the call should be made again, often after a brief waiting period. AWS provides many features to assist in retrying client calls to AWS services when you experience these kinds of errors or exceptions.

If you experience errors such as the following, you might want to add retries to your application code:

Transient errors and exceptions

  • RequestTimeout

  • RequestTimeoutException

  • PriorRequestNotComplete

  • ConnectionError

  • HTTPClientError

Service-side throttling and limit errors and exceptions

  • Throttling

  • ThrottlingException

  • ThrottledException

  • RequestThrottledException

  • TooManyRequestsException

  • ProvisionedThroughputExceededException

  • TransactionInProgressException

  • RequestLimitExceeded

  • BandwidthLimitExceeded

  • LimitExceededException

  • RequestThrottled

  • SlowDown

For more information, as well as example code, on retries, exponential backoff, and jitter, see the following resources: