Git Product home page Git Product logo

aws-profile-switcher's People

Contributors

devtanc avatar jasny avatar leocamilo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aws-profile-switcher's Issues

doesn't support 'aws_session_token' lines

if you're using 2FA authentication in aws landing page you also have lines for "aws_session_token" in your .credentials file. The new implementation braks on "aws_session_token" lines.

Here's a short example of how my entries look like:
[ats-dev]
aws_access_key_id=abcdef
aws_secret_access_key=abcdef
aws_session_token=xxxxxxxx

[ats-prod]
aws_access_key_id=abcdef
aws_secret_access_key=abcdef
aws_session_token=xxxxxxx

please fix

Needs to skip comments in the file

Looks like this code bails out if there are comments in the credential file eg

[some-profle]
#this is no longer used
aws_access_key_id = 1234
aws_secret_access_key = abcd

`--harmony` flag should be removed

This does not work on Linux.

$ switcher list
/usr/bin/env: ‘node --harmony’: No such file or directory
/usr/bin/env: use -[v]S to pass options in shebang lines

We shouldn't need the --harmony flag if we bump the minimum node version requirement to >=8.0

Doesn't modify or read the ~/.aws/config file

The ~/.aws/config file, if present, could cause unexpected behavior, or complete failure. See the info for the file here.
Some important bits here:

Storing Credentials in Config
The AWS CLI will also read credentials from the config file. If you want to keep all of your profile settings in a single file, you can. If there are ever credentials in both locations for a profile (say you used aws configure to update the profile's keys), the keys in the credentials file will take precedence.
If you use one of the SDKs in addition to the AWS CLI, you may notice additional warnings if credentials are not stored in their own file.

The AWS CLI supports named profiles stored in the config and credentials files. You can configure additional profiles by using aws configure with the --profile option or by adding entries to the config and credentials files.

Important
The AWS credentials file uses a different naming format than the CLI config file for named profiles. Do not include the 'profile ' prefix when configuring a named profile in the AWS credentials file.

Currently does not handle a case where no [default] profile is found

If the ~/.aws/credentials file looks something like:

[profile1]
aws_access_key_id = PROFILE1ID
aws_secret_access_key = PROFILE1SECRET

[profile2]
aws_access_key_id = PROFILE2ID
aws_secret_access_key = PROFILE2SECRET

and is missing a [default] profile, then the profile switching will not work correctly.Thinking to add one automatically to the top of the file in these cases.

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.