Created
September 4, 2019 19:34
-
-
Save ghostsquad/5d0166af0db965d68c19396a2766b49f to your computer and use it in GitHub Desktop.
aws creds to env vars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function aws-creds-to-env { | |
profile_name="${1:-default}" | |
AWS_ACCESS_KEY_ID=$(aws configure get "${profile_name}.aws_access_key_id") | |
export AWS_ACCESS_KEY_ID | |
AWS_SECRET_ACCESS_KEY=$(aws configure get "${profile_name}.aws_secret_access_key") | |
export AWS_SECRET_ACCESS_KEY | |
} | |
function aws-creds-out-of-env { | |
unset AWS_ACCESS_KEY_ID | |
unset AWS_SECRET_ACCESS_KEY | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment