It was officially released before I knew it, so I will summarize it
$ sudo port installed | grep py
git-core @1.8.4_0+credential_osxkeychain+doc+pcre+python27 (active)
python27 @2.7.5_1 (active)
・ ・ ・
$ sudo port install py27-pip
$ sudo easy_install pip
$ sudo pip install awscli
$ complete -C aws_completer aws
$ export AWS_ACCESS_KEY_ID=<access_key>
$ export AWS_SECRET_ACCESS_KEY=<secret_key>
With this method, you can write for each environment by specifying porfile.
[default]
aws_access_key_id=<default access key>
aws_secret_access_key=<default secret key>
# Optional, to define default region for this profile.
region=<Region name>
[profile testing]
aws_access_key_id=<testing access key>
aws_secret_access_key=<testing secret key>
region=<Region name>
$ export AWS_CONFIG_FILE=/path/to/config_file
If you install and use aws-cli on your EC2 instance, and you are using IAM, it seems that it will automatically use your Access Key ID and Secret Access Key.
$ aws ec2 describe-instance-status --region <Region name>
$ aws ec2 describe-instance-status --profile=testing
https://github.com/aws/aws-cli
Recommended Posts