icingaweb2-module-aws icon indicating copy to clipboard operation
icingaweb2-module-aws copied to clipboard

Set "retries" for API

Open widhalmt opened this issue 4 years ago • 1 comments

Version 1.1.0 of the AWS module lacks a way of setting retries for API connections. There's a known issue with some versions of AWS SDK that needs to raise the amount of retries because connections are expected to be failing.

For example if you use boto3 you can use the following code to work around known problems with AWS api:

    config = Config(
       retries = {
           'max_attempts': 10,
           'mode': 'standard'
       }
    )

The Changelog of version 3.130.0 of aws-sdk-php says they introduced this setting : https://github.com/aws/aws-sdk-php/releases/tag/3.130.0 By the way, it's the last version to support the old Guzzle version. So 3.130.0 is the only option to not hit https://github.com/Icinga/icingaweb2-module-aws/issues/53 but still be able to set the timeout.

One customer ran some tests and suggested adding such a setting into function initializeSdk() in https://github.com/Icinga/icingaweb2-module-aws/blob/master/library/Aws/AwsClient.php

ref/NC/724192

widhalmt avatar May 28 '21 15:05 widhalmt

The use of environment variables is sufficient for this, e.g .:

AWS_RETRY_MODE=standard
AWS_MAX_ATTEMPTS=10

If you're also using the assume role feature, you may want to add AWS_METADATA_SERVICE_NUM_ATTEMPTS=10.

lippserd avatar Jul 28 '21 13:07 lippserd