Giter VIP home page Giter VIP logo

awsenv's Introduction

awsenv

AWS environment config loader.

awsenv is a small binary that loads AWS environment variables for an AWS profile from ~/.aws/credentials - useful if you're regularly switching credentials and using tools like Vagrant. In addition to aws_access_key_id and aws_secret_access_key, it will also optionally load settings for aws_keyname and aws_keypath.

installation

If you have Go installed, you can just do:

go get -u github.com/soniah/awsenv

This will automatically download, compile and install the app; putting an awsenv executable in your $GOPATH/bin.

Otherwise, download the lastest binary from the releases page and place it in your $PATH (or on Debian-like machines you can just do sudo dpkg -i downloaded.deb).

usage

Import variables into your environment by eval-ing a backticked call to awsenv.

eval `awsenv profile-name`

For example, if you had the following credential files:

% cat ~/.aws/credentials
[example1]
aws_access_key_id = DEADBEEFDEADBEEF
aws_secret_access_key = DEADBEEFDEADBEEF1vzfgefDEADBEEFDEADBEEF

% cat /var/tmp/credentials
[example2]
aws_access_key_id = DEADBEEFDEADBEEF
aws_secret_access_key = DEADBEEFDEADBEEF1vzfgefDEADBEEFDEADBEEF
aws_keyname = 'example2_key'
aws_keypath = "~/.ssh/example2.pem"

The following shell commands would import AWS variables into your environment:

% eval `awsenv example1`
% env | grep AWS
AWS_ACCESS_KEY_ID=DEADBEEFDEADBEEF
AWS_SECRET_ACCESS_KEY=DEADBEEFDEADBEEF1vzfgefDEADBEEFDEADBEEF

% eval `awsenv example2 -f /var/tmp/credentials -v`
AWS_ACCESS_KEY_ID=DEADBEEFDEADBEEF
AWS_SECRET_ACCESS_KEY=DEADBEEFDEADBEEF1vzfgefDEADBEEFDEADBEEF
AWS_KEYNAME=example2_key
AWS_KEYPATH=/Users/sonia/.ssh/example2.pem

flags

The accepted flags can be displayed using -h:

% awsenv -h
Usage:
  awsenv [OPTIONS] Profile

Application Options:
  -v, --verbose   Verbose output
  -f, --filename= Credentials file (~/.aws/credentials)

Help Options:
  -h, --help      Show this help message

Arguments:
  Profile

build

  • edits
  • goxc bump
  • git add . ; git commit -m 'foo msg'
  • git push ; git push --tags
  • goxc -bc='linux,!arm darwin'

Also, copy .goxc.local.json to new build machines, or do:

goxc -wlc default publish-github -apikey=DEADBEEFDEADBEEF

awsenv's People

Contributors

soniah avatar

Watchers

 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.