Skip to content

Instantly share code, notes, and snippets.

@mbarneyjr
Created October 26, 2020 17:58
Show Gist options
  • Save mbarneyjr/5da7a1bcc5f2b972769d76ba9c6d7b46 to your computer and use it in GitHub Desktop.
Save mbarneyjr/5da7a1bcc5f2b972769d76ba9c6d7b46 to your computer and use it in GitHub Desktop.
aws sts assume-role one-liner
export $(aws sts assume-role --role-arn arn:aws:iam::$TARGET_ACCOUNT_ID:role/ci-access --role-session-name ci --output text --query "[['AWS_ACCESS_KEY_ID',Credentials.AccessKeyId],['AWS_SECRET_ACCESS_KEY',Credentials.SecretAccessKey],['AWS_SESSION_TOKEN',Credentials.SessionToken]][*].join(\`=\`,@)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment