Skip to content

Instantly share code, notes, and snippets.

@andytumelty
Created October 2, 2017 09:10
Show Gist options
  • Save andytumelty/431ef107f62da8d3908d5ba135eb37fc to your computer and use it in GitHub Desktop.
Save andytumelty/431ef107f62da8d3908d5ba135eb37fc to your computer and use it in GitHub Desktop.
# Save output of AWS STS Assume Role to temporary credentials file for further use
aws sts assume-role --role-arn arn:aws:iam::12345:role/role_to_assume --role-session-name laycat-session |\
jq '.Credentials | "[default]
aws_access_key_id=\(.AccessKeyId)
aws_secret_access_key=\(.SecretAccessKey)
aws_session_token=\(.SessionToken)
"' | xargs printf > ~/.aws/tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment