/iam-role-injector

Assumes an IAM role via awscli STS call, injecting temporary credentials into shell environment

Primary LanguageShellMIT LicenseMIT

iam-role-injector

The IAM Role Injector is a tool for easily assuming an IAM Role with Multi-Factor Authentication (MFA). It manipulates environment variables to allow codebases already using AWS credentials to use IAM roles with minimal to no refactoring. In the same vein, the Role Injector can also be used to help users using the command line tools to assume a role.

Command Line Usage

source assume_role.sh {accountNumber} {mfaAccountNumber} {rolename} {username}

Calling the script with 'source' is required for the environment variables to persist past the runtime of the script.

The script will also protect your original credentials if you chose to store them as environment variables.

Bugs

Please report any bugs to: https://github.com/civisanalytics/iam-role-injector/issues

Contributing

Open an issue or a pull request if you see how we can improve the script!