0
votes

I have:

  • An AWS account with free tier
  • An Ubuntu 14.04 LTS laptop with a PEM file, and I can create EC2 instances, and SSH into them.
  • AWS command line installed on my laptop
  • Vagrant installed on the laptop
  • AWS plugin installed on Vagrant

In the AWS plugin readme file it gives a template for a Vagrant file:

Vagrant.configure("2") do |config|
  config.vm.box = "dummy"

  config.vm.provider :aws do |aws, override|
    aws.access_key_id = "YOUR KEY"
    aws.secret_access_key = "YOUR SECRET KEY"
    aws.session_token = "SESSION TOKEN"
    aws.keypair_name = "KEYPAIR NAME"

    aws.ami = "ami-7747d01e"

    override.ssh.username = "ubuntu"
    override.ssh.private_key_path = "PATH TO YOUR PRIVATE KEY"
  end
end

How do I get aws.session_token = "SESSION TOKEN" ?

1

1 Answers

2
votes

session_token is the STS (Security Token Service) session token.

you would get the value from amazon CLI (installed and configured to work with your account)

fhenri@machine:~$ aws sts get-session-token --duration-seconds 129600
{
    "Credentials": {
        "SecretAccessKey": "xxxxxxxx",
        "SessionToken": "your token value",
        "Expiration": "2015-11-12T14:23:22Z",
        "AccessKeyId": "xxxxxx"
    }
}