Friday, February 13, 2015

Not to mix EC2_REGION and AWS_REGION environment variables!.

After getting used to AWS CLI, it is sometimes hard to switch back to shell script based cli such as RDSCli . The command line script uses $HOME/.aws/awscredential.txt file to access instead of $HOME/.aws/config file used by AWS CLI. On a similar note, the cli shell script also default the region to us-east-1 and if you would like to query or create assets in a different region, we have to export an environment variable called EC2_REGION. AWS CLI uses AWS_REGION instead.

$ export EC2_REGION=us-west-1
$ rds-describe-db-instances
DBINSTANCE  test  2015-02-14T01:10:43.051Z  db.t2.micro  mysql  5  test  available  test.clulyqjvvos9.us-west-1.rds.amazonaws.com  3306  us-west-1a  7  n  5.6.19b  general-public-license  n
      VPCSECGROUP  sg-5e8e2f3b  active
      PARAMGRP  default.mysql5.6  in-sync
      SUBNETGROUP  default-vpc-1cd71679  Complete
      OPTIONGROUP  default:mysql-5-6  in-sync

No comments:

Post a Comment