Skip to content

Instantly share code, notes, and snippets.

Avatar
🐌

Colin Saliceti saliceti

🐌
  • Department for Education
View GitHub Profile
@saliceti
saliceti / create-token-role.sh
Created Jan 5, 2017 — forked from keymon/create-token-role.sh
Get temporary credentials from AWS using a MFA token, also assuming role: you can assume a role ⁠⁠⁠⁠./create-token-role.sh elasticache-broker-spike-role⁠⁠⁠⁠ or create new tokens for yourself ⁠⁠⁠⁠./create-token-role.sh me 900⁠⁠⁠⁠
View create-token-role.sh
#!/bin/bash
SCRIPT_NAME="$0"
usage() {
cat <<EOF
Creates a set of tokens assuming the given role. Use "me" as role to simply generate a new session token for your user.
Usage:
$SCRIPT_NAME <role name> [duration in seconds]