This repository was archived by the owner on Oct 8, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2- set -x
3- set -v
4-
52set -o errexit # abort on nonzero exit status
6- set -o nounset # abort on unbound variable
73set -o pipefail # don't hide errors within pipes
84
95#
@@ -25,16 +21,21 @@ if [ ${#missing_auth_vars[@]} -ne 0 ]
2521then
2622 echo " Did not find values for:"
2723 printf ' %q\n' " ${missing_vars[@]} "
28- echo " Will assume they are in credentials file"
24+ echo " Will assume they are in credentials file or not needed "
2925else
3026 echo " Creating credentials file"
3127 # Create the directory....
3228 mkdir -p ~ /.aws
3329 CREDS=~ /.aws/credentials
3430 echo " [default]" > $CREDS
3531 echo " aws_access_key_id=$AWS_ACCESS_KEY_ID " >> $CREDS
36- echo " aws_secret_access_key=$AWS_SECRET_ACCESS_KEY " >> $CREDS
37- echo " aws_session_token=$AWS_SESSION_TOKEN " >> $CREDS
32+ echo " aws_secret_access_key=$AWS_SECRET_ACCESS_KEY " >> $CREDS
33+ # This is if we have non-temp credentials...
34+ if [[ -z " ${AWS_SESSION_TOKEN+x} " ]]; then
35+ echo " Variable AWS_SESSION_TOKEN was unset; not adding to credentials"
36+ else
37+ echo " aws_session_token=$AWS_SESSION_TOKEN " >> $CREDS
38+ fi
3839
3940fi
4041
You can’t perform that action at this time.
0 commit comments