Set environment variables for authenticate against aws api. Assume Role and MFA support.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
LICENSE
README.md
aws-session

README.md

aws-session

aws-session sets temporary credential environment variables for a given profile.

Features

  • MFA Support
  • Assume Role Support

Supported Shells

  • sh
  • zsh
  • fish

Installation

homebrew

brew install qoomon/tap/aws-session

Manuel

curl -o /usr/local/bin/aws-session https://raw.githubusercontent.com/qoomon/aws-session/master/aws-session && chmod +x /usr/local/bin/aws-session

Configuration

Setup profiles you would like to assume in ~/.aws/config => aws cli-roles

Usage

aws-session <profile>

If the session requires MFA, you will be asked for the token

assume assume sets following environment variables and then executes the command

  • AWS_ACCESS_KEY_ID

  • AWS_SECRET_ACCESS_KEY

  • AWS_SESSION_TOKEN

  • AWS_DEFAULT_REGION

  • AWS_SESSION_PROFILE

Examples

Print environment variables commands

aws-session company-production

Utils

If you use eval $(aws-session) frequently, you may want to create a alias for it:

  • zsh
alias aws-session='function(){eval "$(./aws-session $@)"}'
  • bash
function aws-session { eval "$( $(which aws-session) "$@")"; }