#!/bin/sh set -e cd "$(dirname "$0")/.." HOST="${HOST:-http://localhost:8282}" if [ $# -eq 0 ]; then echo "Usage:" echo "$0 " exit 1 fi ID_TOKEN="${1}" ROLE_ARN="${2}" echo "$ID_TOKEN" | ruby -rjson -rbase64 -e "puts Base64.decode64(STDIN.read.split('.')[1])" | jq '.' aws sts assume-role-with-web-identity \ --role-arn "${ROLE_ARN}" \ --role-session-name="example-1" \ --duration-seconds 900 \ --web-identity-token="${ID_TOKEN}" \ --output json | cat