In boto3 or botocore, how do I do the equivalent of setting the number of request retries?
e.g. in boto2
from boto import config config.set('Boto', 'num_retries', '20')
How do I do this in boto3? I've tried
conn._session.set_config_variable("num_retries", "20")
but when I then get_config_variable("num_retries")
, None
is returned.
Adaptive retry mode is an experimental retry mode that includes all the features of standard mode. In addition to the standard mode features, adaptive mode also introduces client-side rate limiting through the use of a token bucket and rate-limit variables that are dynamically updated with each retry attempt.
When you specify a profile that has an IAM role configuration, Boto3 will make an AssumeRole call to retrieve temporary credentials. Subsequent Boto3 API calls will use the cached temporary credentials until they expire, in which case Boto3 will then automatically refresh the credentials.
boto3. client function is not thread-safe. It can fail when called from multiple threads · Issue #2750 · boto/boto3 · GitHub.
00:00 Boto3's primary function is to make AWS API calls for you. It extracts these APIs in two main ways: clients and resources. Clients give you low-level service access, while resources provide an object-oriented way of working with these services.
You should now be able to do this, at least for ec2 and perhaps other clients as well:
from botocore.config import Config config = Config( retries = dict( max_attempts = 10 ) ) ec2 = boto3.client('ec2', config=config)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With