Skip to content

Instantly share code, notes, and snippets.

View saliceti's full-sized avatar
🐌

Colin Saliceti saliceti

🐌
  • Department for Education
View GitHub Profile
@saliceti
saliceti / create-token-role.sh
Created January 5, 2017 16:48 — 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⁠⁠⁠⁠
#!/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]