awsctx

Context manager for AWS Profiles

Installation

Demo

asciicast

How it Works

Login

Authorize your shell by some ways with specified profile name. Then, you get ~/.aws/credentials like ``` [foo] awsaccesskeyid = XXXXXXXXXXX awssecretaccesskey = XXXXXXXXXXX awssessiontoken = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

[bar] awsaccesskeyid = YYYYYYYYYYY awssecretaccesskey = YYYYYYYYYYY awssessiontoken = YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY ```

List Profiles

list-contexts shows all the named profiles as the below. console $ ctxm list-contexts foo bar

Use Context

use-context update ~/.aws/credentials to contain default profile that the values are same as specified in the option.

console $ ctxm use-context -p foo e.g. the above commands updates credentials as the below. ``` [foo] awsaccesskeyid = XXXXXXXXXXX awssecretaccesskey = XXXXXXXXXXX awssessiontoken = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

[bar] awsaccesskeyid = YYYYYYYYYYY awssecretaccesskey = YYYYYYYYYYY awssessiontoken = YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY

[default] awsaccesskeyid = XXXXXXXXXXX awssecretaccesskey = XXXXXXXXXXX awssessiontoken = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ```