aws-getsessiontoken

command module
v0.0.0-...-519e545 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2016 License: MIT Imports: 8 Imported by: 0

README

aws-getsessiontoken

A small utility for testing AWS STS GetSessionToken requests.

Usage

First, set your AWS credentials via environment variables.

$ export AWS_ACCESS_KEY_ID=...
$ export AWS_SECRET_ACCESS_KEY=...

Then, run the utility with an IAM Device Serial Number, and enter our MFA Token Code:

$ go run main.go -m -s "arn:aws:iam::123456789012:mfa/justin"
MFA Token Code: 123456

Request: {
  DurationSeconds: 900,
  SerialNumber: "arn:aws:iam::123456789012:mfa/justin",
  TokenCode: "123456"
}

Response: {
  Credentials: {
    AccessKeyId: "ASIAIDABCDEFGHIJKLMN",
    Expiration: 2016-09-28 15:14:37 +0000 UTC,
    SecretAccessKey: "x2AMZpgAzfnR4KmIlqwcJ2KLYG7sHu9dBH+nQkRxbpM",
    SessionToken: "GH/nEHnk846JH99JJiXYG4SyxwS18h9e+dNtMCUs9BwpuHut8KkDV9cMYUtu/RBLaFdMpX8lxWkNwH6+LRd5oN0VMGyAhs+1QWHvJdQVwGUoYi/tPU5dRt4m16QUp/9+r3KBmp5pLzQQ43MLgPgVOnIUqzccbr/YysvB0ess2sY="
  }
}

export AWS_ACCESS_KEY_ID=ASIAIDABCDEFGHIJKLMN
export AWS_SECRET_ACCESS_KEY=x2AMZpgAzfnR4KmIlqwcJ2KLYG7sHu9dBH+nQkRxbpM=
export AWS_SESSION_TOKEN=GH/nEHnk846JH99JJiXYG4SyxwS18h9e+dNtMCUs9BwpuHut8KkDV9cMYUtu/RBLaFdMpX8lxWkNwH6+LRd5oN0VMGyAhs+1QWHvJdQVwGUoYi/tPU5dRt4m16QUp/9+r3KBmp5pLzQQ43MLgPgVOnIUqzccbr/YysvB0ess2sY=

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL