assumerole

command module
v0.0.0-...-7ec9732 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2020 License: MIT Imports: 31 Imported by: 0

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/files

Unfortunately, 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.

# 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
# file: ~/.aws/credentials
[creack]
aws_access_key_id     = foo
aws_secret_access_key = bar

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL