New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for --region and --profile #16

Open
pnewb opened this Issue Sep 21, 2015 · 10 comments

Comments

Projects
None yet
7 participants
@pnewb

pnewb commented Sep 21, 2015

The AWS config file allows for multiple profiles and specifying a particular region if you're in more than one. This allows for having a single configuration file which holds credentials for multiple AWS accounts.

As I've got the [default] entry disabled by default, saws wouldn't function properly. At the moment I've set a particular profile and region as a default just to play around, and it looks pretty nice, but being able to specify profile and region when launching saws would be hugely helpful. (Alternately, if the functionality exists, and I just couldn't figure it out...my apologies.)

@mattford63

This comment has been minimized.

Show comment
Hide comment
@mattford63

mattford63 Sep 21, 2015

I'd love to see this support also. You can split the profile into .aws/credentials and .aws/config allowing people in a company with very many accounts to share the config but not the credentials.

mattford63 commented Sep 21, 2015

I'd love to see this support also. You can split the profile into .aws/credentials and .aws/config allowing people in a company with very many accounts to share the config but not the credentials.

@donnemartin

This comment has been minimized.

Show comment
Hide comment
@donnemartin

donnemartin Sep 21, 2015

Owner

Great suggestion! Currently you'd have to specify region or profile like the following:

being able to specify profile and region when launching saws would be hugely helpful.

I agree, I think supporting a config for region and profile in ~/.sawsrc would do the trick.

Owner

donnemartin commented Sep 21, 2015

Great suggestion! Currently you'd have to specify region or profile like the following:

being able to specify profile and region when launching saws would be hugely helpful.

I agree, I think supporting a config for region and profile in ~/.sawsrc would do the trick.

@pnewb

This comment has been minimized.

Show comment
Hide comment
@pnewb

pnewb Sep 22, 2015

What first came to my mind was more of:
saws --profile development --region us-west-2
and then all further commands would append those by default.

As mattford63 mentioned, you can have the profiles (along with default regions per profile making the --region flag truly optional) in ~/.aws/config where many other tools expect them. You'd be falling closer in line with existing convention, at least in my limited experience.

pnewb commented Sep 22, 2015

What first came to my mind was more of:
saws --profile development --region us-west-2
and then all further commands would append those by default.

As mattford63 mentioned, you can have the profiles (along with default regions per profile making the --region flag truly optional) in ~/.aws/config where many other tools expect them. You'd be falling closer in line with existing convention, at least in my limited experience.

@donnemartin

This comment has been minimized.

Show comment
Hide comment
@donnemartin

donnemartin Sep 22, 2015

Owner
saws --profile development --region us-west-2

Thanks for clarifying!

Owner

donnemartin commented Sep 22, 2015

saws --profile development --region us-west-2

Thanks for clarifying!

@bashtoni

This comment has been minimized.

Show comment
Hide comment
@bashtoni

bashtoni Sep 22, 2015

You can also set the environment variable AWS_DEFAULT_PROFILE, meaning you no longer have to specify the profile for every command.

bashtoni commented Sep 22, 2015

You can also set the environment variable AWS_DEFAULT_PROFILE, meaning you no longer have to specify the profile for every command.

@djhworld

This comment has been minimized.

Show comment
Hide comment
@djhworld

djhworld Sep 22, 2015

I found this works

AWS_PROFILE=myprofile saws

djhworld commented Sep 22, 2015

I found this works

AWS_PROFILE=myprofile saws

@donnemartin

This comment has been minimized.

Show comment
Hide comment
@donnemartin

donnemartin Sep 22, 2015

Owner

Thanks for sharing @bashtoni and @djhworld.

Owner

donnemartin commented Sep 22, 2015

Thanks for sharing @bashtoni and @djhworld.

@donnemartin

This comment has been minimized.

Show comment
Hide comment
@donnemartin

donnemartin Sep 22, 2015

Owner

In the meantime, I'll update the README installation section:

AWS Credentials and Named Profiles

Configure your credentials with the AWS CLI:

$ aws configure

If you'd like to use a specific named profile with SAWS, run the following commands on OS X, Linux, or Unix:

$ export AWS_DEFAULT_PROFILE=user1
$ saws

Or as a one-liner:

$ AWS_DEFAULT_PROFILE=user1 saws

Windows users can run the following commands:

> set AWS_DEFAULT_PROFILE=user1
> saws

Command line options for starting SAWS with a specific profile are under development.

For more details on how to install and configure the AWS CLI, refer to the following documentation.

Owner

donnemartin commented Sep 22, 2015

In the meantime, I'll update the README installation section:

AWS Credentials and Named Profiles

Configure your credentials with the AWS CLI:

$ aws configure

If you'd like to use a specific named profile with SAWS, run the following commands on OS X, Linux, or Unix:

$ export AWS_DEFAULT_PROFILE=user1
$ saws

Or as a one-liner:

$ AWS_DEFAULT_PROFILE=user1 saws

Windows users can run the following commands:

> set AWS_DEFAULT_PROFILE=user1
> saws

Command line options for starting SAWS with a specific profile are under development.

For more details on how to install and configure the AWS CLI, refer to the following documentation.

@DanyC97

This comment has been minimized.

Show comment
Hide comment
@DanyC97

DanyC97 commented Nov 21, 2015

+1

@jamesalbert

This comment has been minimized.

Show comment
Hide comment
@jamesalbert

jamesalbert May 17, 2018

I'm using 0.4.3, have my region set in an environment variable and profile, and while it's using the correct version it still says You must specify a region. You can also configure your region by running "aws configure". every time I refresh with F5. Not sure if it's a big deal, but it should reflect that my region is set. Everything else I'm using is picking it up, maybe I'm missing something?

jamesalbert commented May 17, 2018

I'm using 0.4.3, have my region set in an environment variable and profile, and while it's using the correct version it still says You must specify a region. You can also configure your region by running "aws configure". every time I refresh with F5. Not sure if it's a big deal, but it should reflect that my region is set. Everything else I'm using is picking it up, maybe I'm missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment