Hello,
I'm experiencing the same issue as reported on https://forums.aws.amazon.com/thread.jspa?threadID=237416 where sometimes an EC2 instance, although launched with an IAM role, isn't able to perform API calls (e.g. download from S3) and fails with "Unable to locate credentials."
This breaks bootstrap scripts that rely on the EC2 instance being able to work with other AWS resources.
A --retry
option will make it possible to automatically retry, potentially with a backoff, the same request several times to overcome such failures.
You can increase the retry count by setting metadata_service_num_attempts
in your config file. For example:
aws configure set metadata_service_num_attempts 5 --profile profile-name
--profile
can be omitted if you're setting it on the default profile.
Sure, but this fails on AWS EC2:
$ aws configure set metadata_service_num_attempts 5
$ aws s3 cp s3://foo/bar /foo/bar
'str' object cannot be interpreted as an integer
$
Supposedly fixed here.
EDIT: Might be the Debian image I'm using... sigh
Most helpful comment
You can increase the retry count by setting
metadata_service_num_attempts
in your config file. For example:aws configure set metadata_service_num_attempts 5 --profile profile-name
--profile
can be omitted if you're setting it on the default profile.