#! /bin/bash # # Expects a profile name as the first argument. No error checking. # Wait for successful credential report while [[ "$( aws --profile $1 iam generate-credential-report | jq -r .State)" != "COMPLETE" ]]; do >&2 echo "Credential report not ready. Waiting..." sleep 1 done aws --profile $1 iam get-credential-report | jq -r .Content | base64 --decode