[PYTHON] Change retry settings with boto3

python 3.7 boto3 1.4.4

Error retry and exponential backoff on AWS

Each AWS SDK implements automatic retry logic

Either change it in the config file or change it in code For configuration files, it also works with the AWS CLI

setting file

Prepare ~ / .aws / models / _retry.json. The writing method is the same as _retry.json of the botocore package. http://botocore.readthedocs.io/en/latest/reference/loaders.html

Directly change the value of the client retry handler

boto2.num_retries equivalent in retryhandler.py or _retry.json #882

import boto3

client = boto3.client('stepfunctions')
client.meta.events._unique_id_handlers['retry-config-states']['handler']._checker.__dict__['_max_attempts'] = 1

The states part of retry-config-states is the value for each service. In the above example, the number of retries in step functions is set to 1.

Currently, a PR that allows you to specify settings for each session is waiting for a merge Add possibility of modifying retry_config #891

Recommended Posts

Change retry settings with boto3
Change batch settings with Mailman's withlist command
change vim settings
Tested with boto3 + mock
Region specification with boto
S3 uploader with boto
Retry with python requests
Change IP settings to ACL of conoha with python
Set connection timeout with boto3
S3 operation with python boto3
[Python] Change dtype with pandas
Try Juniper JUNOS PyEz (python library) Memo 3 ~ Change settings with PyEz ~
Change node settings in supernodes with SPSS Modeler Python scripts
Get AWS account ID with boto3
Change point detection with Kalman filter
Connect to Elastic MQ with boto
Use boto3 to mess with S3
Generate S3 signed URL with boto