Skip to content

Instantly share code, notes, and snippets.

View ndt75's full-sized avatar

Dan Nguyen ndt75

View GitHub Profile
@ndt75
ndt75 / aws_cli_mfa.sh
Last active October 29, 2019 17:50
Authenticate AWS CLI with MFA
function devmfa() {
##################################################################################################
# TODO: fill out these 2 variables
##################################################################################################
# This is the profile with access keys associated with your AWS user account.
# These keys are useless when MFA is enabled or required for the CLI.
# However, we can use these keys to call "aws sts get-session-token" along with the MFA code
# to get a set of temporary credentials and store then in AWS env variables for the CLI to consume.
# i.e. this profile should be existing in `.aws/credentials`