Skip to content

Commit 43feacf

Browse files
committed
chore: reset credentials
Signed-off-by: Kevin Shan <[email protected]>
1 parent 7c73594 commit 43feacf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

shared-scripts.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,10 @@ function useChildAccountCredentials {
364364
echo "Unable to find a child account. Falling back to parent AWS account"
365365
return
366366
fi
367+
unset AWS_ACCESS_KEY_ID
368+
unset AWS_SECRET_ACCESS_KEY
369+
unset AWS_SESSION_TOKEN
370+
367371
creds=$(aws sts assume-role --role-arn arn:aws:iam::${pick_acct}:role/OrganizationAccountAccessRole --role-session-name testSession${session_id} --duration-seconds 3600)
368372
if [ -z $(echo $creds | jq -c -r '.AssumedRoleUser.Arn') ]; then
369373
echo "Unable to assume child account role. Falling back to parent AWS account"

0 commit comments

Comments
 (0)