0
votes

I am using aws-cli to download application configuration on startup. I'm testing it both on the Amazon Linux AMI and Ubuntu Server AMI, on the Ubuntu server I install the cli via apt-get awscli.

To both instances I have set the same IAM role with read access to S3. On the Amazon Linux instance I am able to download the configuration with the following command:

aws s3 cp s3://myconfbucket/conf.json conf.json

and it resolves the region by itself. On the Ubuntu Server instance I have to provide -- region eu-west-1.

How is the Amazon Linux instance able to resolve the region and how could I get the same behaviour on the Ubuntu Server instance?

1

1 Answers

2
votes

Has the aws configure command been run on the Amazon Linux machine at some point? Does that machine have a ~/.aws directory with some config files in it? I'm pretty sure the CLI on both instances would be defaulting to the us-east-1 region unless there was a configuration file specifying a different default region.