GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - SanderKnape/assume: A simple CLI utility that makes it easier to switch between different AWS roles

BranchesTags
Open more actions menu

Latest commit

 

History

14 Commits
14 Commits

Folders and files

NameName
Last commit message
Last commit date
aws_assume_role_helper
aws_assume_role_helper
 
 
.editorconfig
.editorconfig
 
 
.flake8
.flake8
 
 
.gitignore
.gitignore
 
 
.pylintrc
.pylintrc
 
 
.travis.yml
.travis.yml
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
setup.py
setup.py
 
 

Repository files navigation

AWS Assume Role Helper

Build Status

assume is a simple CLI utility that makes it easier to switch between different AWS roles. This is helpful when you work with different AWS accounts or users. In addition, this utility is helpful when you develop AWS resources locally (such as an application that will run on EC2 or when running a Lambda function locally using AWS SAM). You can easily switch to a role that your EC2 instance / Lambda function will assume in AWS.

What this command actually does is change your AWS credentials file (~/.aws/credentials). If there is a default role in there, it will be stored in a temporary role. The assumed role is then passed in the default role, so you can immediately start using it.

Table of Contents

  • Prerequisites
  • Installation
  • Usage
  • Alternatives

Prerequisites

Install Python. Versions 3.5 and 3.6 are supported.

Installation

Use pip to install `assume':

pip install assume

Run the following to show all available commands:

assume --help

Usage

Add a new role to assume as follows:

assume add [rolename] --role-arn [arn] --profile [profile]

Specifying the profile is optional. When you don't specify this, the default profile is used. The following would add a new role "myrole" to be assumed:

assume add myrole --role-arn arn:aws:iam::012345678912:role/myrole

You can now assume this role as follows:

assume switch myrole

assume keeps a configuration file in ~/.assume/config.yaml. You can list the contents of the current configuration with the following file:

assume list

When you want to switch back to your initial default role, you can clear the assumed role as follows:

assume clear

To remove a role to be assumed, run the following command:

assume remove myrole

This command grabs the default role that was stored in a temporary location when running the switch command. These credentials are then put back in the default role.

Alternatives

I'm aware that a number of alternatives already exist with similar functionality. The reason I decided to build my own functionality is because I wasn't be able to find an existing option that combines all of the following features:

  • Easy switching using shortcuts
  • Easily remove the temporarry role and switch back to the original one

About

A simple CLI utility that makes it easier to switch between different AWS roles

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

45 stars

Watchers

0 watching

Forks

9 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.