I have the default region set in ~/.aws/config file:
[default]
region=us-west-2
However, when I try describe-instances command for some specific profile it is failing with the following message:
$ aws ec2 describe-instances --profile my_profile
You must specify a region. You can also configure your region by running "aws configure".
Shouldn't it used the default profile configured in ~/.aws/config file? What am I missing here?
Output of aws configure list:
Name Value Type Location
---- ----- ---- --------
profile <not set> None None
access_key ******************** shared-credentials-file
secret_key ******************** shared-credentials-file
region us-west-2 config-file ~/.aws/config
Output of aws configure list --profile my_profile
Name Value Type Location
---- ----- ---- --------
profile my_profile manual --profile
access_key ******************** shared-credentials-file
secret_key ******************** shared-credentials-file
region <not set> None None
p.s. new to AWS. pardon me if this is a very basic question.