Skip to content

Commit

Permalink
Revert "refactor: cleanup code (widdix#87)"
Browse files Browse the repository at this point in the history
This reverts commit 3138859.
  • Loading branch information
michaelwittig committed Oct 27, 2017
1 parent 8932eb4 commit 28a6cad
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions import_users.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,17 @@ function setup_aws_credentials() {
local stscredentials
if [[ ! -z "${ASSUMEROLE}" ]]
then
stscredentials=($(aws sts assume-role \
stscredentials=$(aws sts assume-role \
--role-arn "${ASSUMEROLE}" \
--role-session-name something \
--query '[Credentials.SessionToken,Credentials.AccessKeyId,Credentials.SecretAccessKey]' \
--output text))
--output text)

export AWS_ACCESS_KEY_ID=${stscredentials[0]}
export AWS_SECRET_ACCESS_KEY=${stscredentials[1]}
export AWS_SESSION_TOKEN=${stscredentials[2]}
AWS_ACCESS_KEY_ID=$(echo "${stscredentials}" | awk '{print $2}')
AWS_SECRET_ACCESS_KEY=$(echo "${stscredentials}" | awk '{print $3}')
AWS_SESSION_TOKEN=$(echo "${stscredentials}" | awk '{print $1}')
AWS_SECURITY_TOKEN=$(echo "${stscredentials}" | awk '{print $1}')
export AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_SECURITY_TOKEN
fi
}

Expand Down

0 comments on commit 28a6cad

Please sign in to comment.