Skip to content

Instantly share code, notes, and snippets.

@jpribyl
jpribyl / aws-mfa-access.sh
Last active November 25, 2019 10:14 — forked from geekgunda/aws-mfa-access.sh
aws-cli MFA access via assume role
#!/bin/bash
# Assumption:
# 1. Your original AWS Creds should be stored at ~/.aws/credentials
# 2. You've corrected ARN for MFA device (search for FIXME)
# 3. You've given correct MFA Code as cli argument
# 4. You have jq installed. Ref: https://stedolan.github.io/jq/
if [ "$1" == "" ]; then
echo "Usage: `basename "$0"` <MFA-TOKEN>"
exit