I have several lambda functions that create mutliple AWS Elastic beanstalk API Call, written in python. It worked fine. but from the last few days we get the Throttling error. After discussing with AWS, they said adding exponential return logic to the code. Therefore, if it is throttled, it will repeat the same API call for an incremental interval. I got what they say and how it works, but I donβt understand how to add to my code. They have documentation for the CLI, but they do not have for the API, as follows, http://docs.aws.amazon.com/general/latest/gr/api-retries.html
can someone please give me a simple example of how we can match the response of an API call and try again if it throttles like my one api call, which I use in my code as shown below,
import boto3 conn = boto3.client('elasticbeanstalk') response = conn.describe_environments(EnvironmentNames=["xyz"]) return response
I know a simple way to do this, if the condition is by checking the answer "Speeding", while I think I can do it. but I want to check, as shown in the CLI example, how can I do this for the API?
Any help would be appreciated!
python api amazon-web-services elastic-beanstalk
Meet101
source share