Skip to content

Commit 28a6cad

Browse files
committed
Revert "refactor: cleanup code (widdix#87)"
This reverts commit 3138859.
1 parent 8932eb4 commit 28a6cad

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

import_users.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,17 @@ function setup_aws_credentials() {
5656
local stscredentials
5757
if [[ ! -z "${ASSUMEROLE}" ]]
5858
then
59-
stscredentials=($(aws sts assume-role \
59+
stscredentials=$(aws sts assume-role \
6060
--role-arn "${ASSUMEROLE}" \
6161
--role-session-name something \
6262
--query '[Credentials.SessionToken,Credentials.AccessKeyId,Credentials.SecretAccessKey]' \
63-
--output text))
63+
--output text)
6464

65-
export AWS_ACCESS_KEY_ID=${stscredentials[0]}
66-
export AWS_SECRET_ACCESS_KEY=${stscredentials[1]}
67-
export AWS_SESSION_TOKEN=${stscredentials[2]}
65+
AWS_ACCESS_KEY_ID=$(echo "${stscredentials}" | awk '{print $2}')
66+
AWS_SECRET_ACCESS_KEY=$(echo "${stscredentials}" | awk '{print $3}')
67+
AWS_SESSION_TOKEN=$(echo "${stscredentials}" | awk '{print $1}')
68+
AWS_SECURITY_TOKEN=$(echo "${stscredentials}" | awk '{print $1}')
69+
export AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN AWS_SECURITY_TOKEN
6870
fi
6971
}
7072

0 commit comments

Comments
 (0)