Skip to content

Instantly share code, notes, and snippets.

@rot26
Last active May 21, 2020 21:45
Show Gist options
  • Save rot26/ca53b38031e6375960b9f0c949d50e9b to your computer and use it in GitHub Desktop.
Save rot26/ca53b38031e6375960b9f0c949d50e9b to your computer and use it in GitHub Desktop.
[AWS Get Session Token Vars] Get the vars from an aws session token. #aws #cicd
docker run \
-e "AWS_SESSION_TOKEN=${session_token}" \
-e "AWS_ACCESS_KEY_ID=${access_key_id}" \
-e "AWS_SECRET_ACCESS_KEY=${secret_access_key}" \
-e "AWS_DEFAULT_REGION=us-east-1" \
-v $PWD:/usr/src/app -w /usr/src/app \
node:12 npm run cdk -- -v synth
#!/usr/bin/env bash
jq --version
content=$(aws sts get-session-token)
session_token=$(echo $content | jq -r '.Credentials.SessionToken')
access_key_id=$(echo $content | jq -r '.Credentials.AccessKeyId')
secret_access_key=$(echo $content | jq -r '.Credentials.SecretAccessKey')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment