metadata_service_num_attempts - AWS SDKs and Tools Shared Configuration and Credentials

metadata_service_num_attempts

Specifies the number of attempts to make before giving up when attempting to retrieve data from the instance metadata service.

Details

When attempting to retrieve credentials on an Amazon EC2 instance that has been configured with an IAM role, the connection to the instance metadata service times out after one second by default. If you know you're running on an Amazon EC2 instance with an IAM role configured, you can increase this value, if needed.

Ways to set this value

Location Supported Example
config file X
metadata_service_num_attempts=10
credentials file -
Environment variable X Linux/macOS
export AWS_METADATA_SERVICE_NUM_ATTEMPTS=10
Windows
setx AWS_METADATA_SERVICE_NUM_ATTEMPTS 10
CLI parameter -

Compatibility with AWS SDKS and tools