Created
August 26, 2021 04:51
-
-
Save MatteoGioioso/ed6b9c49df69d39ba87e3d70d9e7aaf9 to your computer and use it in GitHub Desktop.
Source aws credentials, this could be useful for using AWS in a container
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 sh | |
AWS_PROFILE="${AWS_PROFILE:-default}" | |
export AWS_ACCESS_KEY_ID=$(sed -nr "/^\[${AWS_PROFILE}\]/ { :l /^aws_access_key_id[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" "$HOME"/.aws/credentials) | |
export AWS_SECRET_ACCESS_KEY=$(sed -nr "/^\[${AWS_PROFILE}\]/ { :l /^aws_secret_access_key[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" "$HOME"/.aws/credentials) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment