This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
CREDS=$(aws sso get-role-credentials --profile $1 \ | |
--output json \ | |
--access-token $(jq -r ".accessToken" $(grep -l "accessToken" ~/.aws/sso/cache/*.json)) \ | |
--account-id $(aws configure get sso_account_id --profile $1) \ | |
--role-name $(aws configure get sso_role_name --profile $1) | | |
jq '.roleCredentials | { | |
Version: 1, | |
AccessKeyId: .accessKeyId, |