Code Monkey home page Code Monkey logo

aws-mfa's Introduction

AWS-MFA

Code Climate

Introduction

aws-mfa prepares the environment for commands that interact with AWS. It uses AWS STS to get temporary credentials. This is necessary if you have MFA enabled on your account. The variables it sets are

  • AWS_SECRET_ACCESS_KEY
  • AWS_ACCESS_KEY_ID
  • AWS_SESSION_TOKEN
  • AWS_SECURITY_TOKEN

Installation

aws-mfa is available via Rubygems. To install it you can run gem install aws-mfa.

Before using aws-mfa, you must have the AWS CLI installed (through whatever method you choose) and configured (through aws configure).

Usage

The very first time you run aws-mfa it will fetch the ARN for your MFA device and ask you to confirm it. Next, it will prompt you for the 6-digit code from your MFA device. For the next 12 hours, aws-mfa will not prompt you for anything. After 12 hours, your temporary credentials expire, so aws-mfa will prompt you for the 6-digit code again.

There are two ways you can use aws-mfa:

Eval

The first is to use it to alter the environment of your current shell. To do this, run eval $(aws-mfa). Now any command that uses the standard AWS environment variables should work.

Wrapper

The second is to use it to alter the environment of a single invocation of a program. aws-mfa tries to execute its arguments. aws-mfa aws would run the aws cli, aws-mfa kitchen would run test-kitchen, and so on. You can safely setup an alias with alias aws=aws-mfa aws. With the alias, if you had set up autcompletion for aws it will still work.

aws-mfa's People

Contributors

sciurus avatar

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.