Skip to content
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

Docker with AWS credentials stored externally #67

Open
jpvlsmv opened this issue Sep 20, 2019 · 1 comment
Open

Docker with AWS credentials stored externally #67

jpvlsmv opened this issue Sep 20, 2019 · 1 comment

Comments

@jpvlsmv
Copy link

jpvlsmv commented Sep 20, 2019

I store my AWS credentials far, far away from my Terraform source code, preferring per-project access keys and a profile configured via aws configure. I add 2 additional options to my docker run command:

  -v ~/.aws:/root/.aws -e AWS_PROFILE=projectprofile \

Adding the volume ~/.aws gives the scripts access to the saved keys I have, and the environment tells which one to use.

Hope this may help somebody.

@edobry
Copy link

edobry commented Jul 13, 2020

This was helpful, thank you @jpvlsmv!

My setup is slightly more complex, as I'm using an organization authentication account, and then assuming account profiles; I had to add some more flags, but this got it working for me:

 -v ~/path/to/org/aws/config/file:/root/terraform/aws \
 -v ~/.aws:/root/.aws \
 -e AWS_PROFILE="account-profile=name" \
 -e AWS_SDK_LOAD_CONFIG=1 \
 -e AWS_CONFIG_FILE="/root/terraform/aws/config" \

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants