Versent / unicreds

unicreds is a CLI which manages secrets in AWS using DynamoDB and KMS.
https://github.com/Versent/unicreds
MIT License
117 stars 39 forks source link

Allow using AWS_PROFILE env variable in combination with ~/.aws/config #76

Closed sleepdeprecation closed 6 years ago

sleepdeprecation commented 6 years ago

Similar to #65 and #70, this change allows users to use standard AWS command line flags with unicreds, and have the application read from ~/.aws/config, so that configured profiles are available.

Allows

unicreds list --region us-east-1 -t table -p root_profile -R arn:aws:iam::account_id:role/role_name

to be replaced with

AWS_PROFILE=role_profile unicreds list --region us-east-1 -t table

Assuming that role_profile is configured in ~/.aws/config with

[profile role_profile]
role_arn = arn:aws:iam::account_id:role/role_name
source_profile = root_profile
sleepdeprecation commented 6 years ago

@wolfeidau any thoughts? Is this good to go?

The test failures are because the upstream AWS SDK changed an interface, and the mock no longer fulfills the interface, unrelated to this code.

wolfeidau commented 6 years ago

Heya this is an interesting idea.

I need to do a release to bump and vendor upstream deps so I will do that in the next couple of days, then we can compare notes on this.

afirth commented 6 years ago

be good to update the usage with this PR too. Can confirm the build passes with #78 in as well. https://travis-ci.org/flippa/unicreds/builds/338795559

afirth commented 6 years ago

Also, should this respect the region set in the profile?

$ cat ~/.aws/config
[default]
region = us-east-1
$ unicreds  list
   ⨯ failed                    error=MissingRegion: could not find region configuration
sleepdeprecation commented 6 years ago

@afirth new commit now respects the region set in the profile. Working on usage docs.

sleepdeprecation commented 6 years ago

Usage documentation updated to include using AWS_* env variables and respecting the credentials/config documentation.

wolfeidau commented 6 years ago

If you rebase master I have merged the PR #78 and i will merge.

sleepdeprecation commented 6 years ago

Rebased against master, waiting for CI.

aerostitch commented 6 years ago

Hi, I'd be really interested in this, any word on when it will be merged? Thanks Joseph