Skip to content

Instantly share code, notes, and snippets.

@ellemenno
ellemenno / aws-session
Last active July 7, 2022 14:17 — forked from ogavrisevs/aws-temp-token.sh
Script to retrieve temp auth token from AWS STS
#!/bin/bash
# Uses AWS CLI and user-provided MFA code to retrieve and store
# temp session credentials from AWS Security Token Service (STS),
# - for user sessions via get-session-token
# - or role sessions via assume-role
#
# Stores 'token_expiration' in the profile to enable checks on session time left