Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/creack/assumerole
Assume AWS role and auto refresh tokens.
https://github.com/creack/assumerole
Last synced: about 1 month ago
JSON representation
Assume AWS role and auto refresh tokens.
- Host: GitHub
- URL: https://github.com/creack/assumerole
- Owner: creack
- License: mit
- Created: 2019-02-28T19:03:55.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-16T06:26:35.000Z (about 4 years ago)
- Last Synced: 2024-06-20T11:47:05.865Z (6 months ago)
- Language: Go
- Size: 1.88 MB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# assumerole
Assume AWS role and auto refresh tokens.
# Caveat
Botocore doesn't display stderr, so in case the MFA is needed, the aws cli will not display the message, but still expect an input.
To get the message to display, apply this patch: https://github.com/boto/botocore/pull/1349/filesUnfortunately, the patch doesn't work with aws-cli v2 which embed a pre-compiled version of botocore.
# Example config.
NOTE: This tool expects the non-standard `_role_arn` as the CLI will not call the credential_process if it finds the `role_arn` key.
```ini
# file: ~/.aws/config[DEFAULT]
source_profile = creack
region = us-east-1
credential_process = assumerole
mfa_serial = arn:aws:iam::12342:mfa/creack
output = json
cli_pager = cat[profile creack-base]
# Voluntary left blank with a profile name distinct from the static credentials.
# Allows to use the IAM user itself with 2FA without assuming a different role.[profile dev]
_role_arn = arn:aws:iam::1234200:role/devrole[profile prod]
_role_arn = arn:aws:iam::1234201:role/prodrole
``````ini
# file: ~/.aws/credentials
[creack]
aws_access_key_id = foo
aws_secret_access_key = bar
```