Skip to content

Commit

Permalink
refactor: cleanup code (widdix#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
qoomon authored and michaelwittig committed Oct 5, 2017
1 parent 3065644 commit 3138859
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions import_users.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,15 @@ 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))

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
export AWS_ACCESS_KEY_ID=${stscredentials[0]}
export AWS_SECRET_ACCESS_KEY=${stscredentials[1]}
export AWS_SESSION_TOKEN=${stscredentials[2]}
fi
}

Expand Down

0 comments on commit 3138859

Please sign in to comment.