rubyonjets / jets

Ruby on Jets
http://rubyonjets.com
MIT License
2.6k stars 181 forks source link

Feature Request: Support AWS Profiles #85

Closed wwboynton closed 5 years ago

wwboynton commented 5 years ago

I might be crazy, but after twenty minutes of googling and doc-diving, I can't find any documentation on how to feed my AWS credentials to jets. It seems like it uses the default creds stored in ~/.aws/credentials, but does not respect AWS_DEFAULT_PROFILE to allow me to, say, deploy my production resources to a different account than my pre-prod resources, which is a really common pattern.

I might just be up late and missing something really obvious, though.

tongueroo commented 5 years ago

@wwboynton The env var is AWS_PROFILE. Believe AWS_DEFAULT_PROFILE is deprecated. Will add some docs on this.

tongueroo commented 5 years ago

Here are the AWS docs https://docs.aws.amazon.com/cli/latest/userguide/cli-multiple-profiles.html for now. Example:

~/.aws/credentials:

[default]
aws_access_key_id=AKIAIOSFODNN7EXAMPLE
aws_secret_access_key=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

[prod]
aws_access_key_id=AKIAI44QH8DHBEXAMPLE
aws_secret_access_key=je7MtGbClwBF/2Zp9Utk/h3yCo8nvbEXAMPLEKEY

~/.aws/config:

[default]
region=us-west-2
output=json

[profile prod]
region=us-east-1
output=text

To deploy to different accounts:

jets deploy
AWS_PROFILE=prod jets deploy

Should work.

tongueroo commented 5 years ago

@wwboynton Deploy docs have been updated: http://rubyonjets.com/docs/deploy/ Closing out.

wwboynton commented 5 years ago

Your promptness and doc update is appreciated :) always great to see ambitious projects that are actually under active development!