Git Product home page Git Product logo

fm-assume-role's Introduction

FM ASSUME ROLE

This module makes a life a bit easier when working with AWS assume roles by adding an one line cli-interface to automatically allowing temporary credentials to work when doing deployment etc.

To Install (globally)

npm install -g fm-assume-role

Usage

Important : this will be using your [default] AWS profile credentials to assume the roles. So it is important to set this default credentials on you aws config file and be able to assume roles from other accounts using this credentials.

1. Using AWS profile

You can customise the ~/.aws/credentials files and add role_arn or account_number to any profile and use this tool to assume roles easily.

e.g

~/.aws/credentials

[myserver-prod]
aws_access_key_id = YOUR_ACCESS_KEY (this is optional for this tool)
aws_secret_access_key = YOUR_SECRET_KEY (this is optional for this tool)
role_arn = arn:aws:iam::123456789101:role/testing
account_number = 123456789101

then you can do,

fm-assume-role --profile="myserver-prod" --bashcommand="sls deploy --stage=prod"

or

fm-assume-role --profile="myserver-prod" --role="testing" --bashcommand="sls deploy --stage=prod"

role_arn will have priority over account_number. if you didnt specify the --role , role will be defaulted to temporary_access_to_devs

2. Specifying role_arn or accountnumber in CLI

e.g.

fm-asssume-role --role_arn="arn:aws:iam::123456789101:role/testing" --bashcommand="sls deploy --stage=prod"

fm-asssume-role --accountnumber="123456789101" --bashcommand="sls deploy --stage=prod"

Note

If you avoid the --bashcommand flag and tool will only copy the new access details onto your clipboard, then you can past it on any terminal window and get access for that bash window. all subsequent aws calls will on that bash window will use the new credentials(until the token expires)

Available Options

fm-assume-role
    --role_arn
    --sessionname
    --duration
    --verbose
    --role
    --accountnumber
    --bashcommand
    --profile
    --v || --version

If you come across with any issues, please open a issue in the github repo with the details of the issue.(including which operating system you are using)

fm-assume-role's People

Contributors

mahathun avatar

Stargazers

Paula Ceccon avatar

Watchers

James Cloos avatar  avatar

fm-assume-role's Issues

Clipboard issue

On Windows, when using the windows terminal, credentials don't automatically copy to the clipboard.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.