Skip to content

Commit

Permalink
updated aws_sso_configs.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
HariSekhon committed Nov 22, 2024
1 parent 3d05e09 commit 956f476
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion aws/aws_sso_configs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ timestamp "Getting AWS SSO accounts this account has access to"
while read -r id _email name; do
name="$(tr '[:upper:]' '[:lower:]' <<< "$name" | sed 's/[^[:alnum:]]/-/g')"
timestamp "Looking up available roles for account '$name' ($id)"
roles="$(aws sso list-account-roles --account-id "$id" --access-token "$access_token")"
roles="$(
aws sso list-account-roles \
--account-id "$id" \
--access-token "$access_token" \
--query 'roleList[*].roleName' \
--output text |
tr '[:space:]' '\n'
)"
if grep -Fxq "$role" <<< "$roles"; then
sso_role="$role"
else
Expand Down

0 comments on commit 956f476

Please sign in to comment.