Simple CLI to source and cache AWS credentials
Project description
Usage of awsenv
-
Install
boto3
to your base env -
Add the following awsenv function to your shell resource config (e. g. .zshrc or .oh-my-zsh/custom/awsenv.zsh)
awsenv(){
path_to_awsenv_py="$HOME/code/awsenv/awsenv.py"
eval $(python $path_to_awsenv_py $@)
}
- Add a
config.jsonc
(note the c for comment) with the following strutucture under~/.awsenv/config.json
{
"AWS_DEFAULT_REGION": "eu-central-1",
"AWS_DEFAULT_OUTPUT": "json",
"AWS_PAGER": "",
"defaultUser": "<your-name-you-want-to-login-with-by-default,must-match-a-name-below-in-users>",
"defaultRole": "<some-role-name>",
"defaultAccount": "<some-account-id>",
"defaultDuration": 3600,
"users": {
"<your-name-1>": {
"AWS_ACCESS_KEY_ID": "<your-access-key>",
"AWS_SECRET_ACCESS_KEY": "<your-secret-access-key>",
"SERIAL_NUMBER": "<your-mfa-serial>"
}
},
"predefinedShortcuts": {
"<some-shortcut-1>": {
"user": "<your-name>",
"role": "<some-role-name>",
"account": "617095144398",
"duration": 43200
},
"<some-shortcut-2>": {
"user": "<your-name>",
"role": "<some-role-name>",
"account": "<some-account-id>",
"duration": 3600
}
}
}
Development of awsenv
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
awsenv-cli-0.0.2.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for awsenv_cli-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30c8653df093a277ea7dd9c1a9cea084d9d81aa7355657fbe4625d0c9fbd5cdb |
|
MD5 | b092f8993cd3b1924d66c426c185676e |
|
BLAKE2b-256 | f836bad3d0e19e6afc6ad7e1eeaab8d3e26f1abefdfb7c200401b77bf07b6554 |