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.
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)