Skip to content

Instantly share code, notes, and snippets.

@mvaaltola
mvaaltola / get-aws-mfa-vars.sh
Created December 16, 2021 09:04
Get AWS MFA session and store environment variables in /tmp/aws-mfa-token.
#!/usr/bin/env bash
set -e
if ! command -v aws &>/dev/null; then
echo "Command aws not found: install AWS CLI first!" >&2
exit 1
fi
if [ "$#" -ne 2 ]; then