Skip to content

Instantly share code, notes, and snippets.

@lukasz-kaniowski
Created January 10, 2019 14:25
Show Gist options
  • Save lukasz-kaniowski/2a772d437192f5d28b3a8cddaad68d64 to your computer and use it in GitHub Desktop.
Save lukasz-kaniowski/2a772d437192f5d28b3a8cddaad68d64 to your computer and use it in GitHub Desktop.
Assume role for aws cli

Instructions

Modify files under ~/.aws directory

Usage

Use it as you would normally use aws profiles for cli

# Replace ${ASSUME_ROLE_ARN} with role arn that you want to assume
# Replace ${USER_ARN} with your user
[profile user]
region=eu-west-1
[profile env-role]
role_arn = ${ASSUME_ROLE_ARN}
source_profile = user
region = eu-west-1
mfa_serial = ${USER_ARN}
[user]
aws_access_key_id=${REPLACE_ME}
aws_secret_access_key=${REPLACE_ME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment