Commit b2b170f4 by Kevin Falcone

Extra set +xing and variable name fix.

parent 5b9807d5
...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
# assume-role function for use by machine services that don't use MFA to assume role. # assume-role function for use by machine services that don't use MFA to assume role.
# source this into your bash script and then # source this into your bash script and then
# set +x #
# assume-role(${AWS_MFA_ARN}) # assume-role(${AWS_ROLE_ARN})
# set -x #
# You can skip set +-x if you aren't concerned about leaking the tokens in your logs. # The function turns off echoing, so no tokens are exposed.
# If you wish to hide your Role's ARN, you can set +x before calling the function.
assume-role() { assume-role() {
set +x
ROLE_ARN="${1}" ROLE_ARN="${1}"
SESSIONID=$(date +"%s") SESSIONID=$(date +"%s")
...@@ -20,5 +22,6 @@ assume-role() { ...@@ -20,5 +22,6 @@ assume-role() {
export AWS_SECRET_ACCESS_KEY=${RESULT[1]} export AWS_SECRET_ACCESS_KEY=${RESULT[1]}
export AWS_SECURITY_TOKEN=${RESULT[2]} export AWS_SECURITY_TOKEN=${RESULT[2]}
export AWS_SESSION_TOKEN=${AWS_SECURITY_TOKEN} export AWS_SESSION_TOKEN=${AWS_SECURITY_TOKEN}
set -x
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment