mitchellh / vagrant-aws

Use Vagrant to manage your EC2 and VPC instances.
MIT License
2.61k stars 571 forks source link

How does one get the aws session token? #405

Open waygee opened 9 years ago

waygee commented 9 years ago

Not sure how to get the aws session token mentioned in the example. Can someone provide any assistance here? Is it a necessary setting?

waygee commented 9 years ago

ok, found my own answer.

  1. Download and install the Amazon Command Line Interface http://docs.aws.amazon.com/cli/latest/userguide/installing.html
  2. Configure the command line interface http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html $aws configure
  3. Request the session token $aws sts get-session-token --duration-seconds 129600 (enter your own duration)
waygee commented 9 years ago

I entered the SecretAccessKey, Session Token, and AccessKeyId from the get-session-token request I made earlier, and now I am getting this error message:

$ vagrant up --provider=aws Bringing machine 'default' up with 'aws' provider... ==> default: Warning! The AWS provider doesn't support any of the Vagrant ==> default: high-level network configurations (config.vm.network). They ==> default: will be silently ignored. ==> default: Launching an instance with the following settings... ==> default: -- Type: m3.medium ==> default: -- AMI: ami-7747d01e ==> default: -- Region: us-east-1 ==> default: -- Keypair: dev ==> default: -- Block Device Mapping: [] ==> default: -- Terminate On Shutdown: false ==> default: -- Monitoring: false ==> default: -- EBS optimized: false ==> default: -- Assigning a public IP address in a VPC: false There was an error talking to AWS. The error message is shown below:

UnauthorizedOperation => You are not authorized to perform this operation. Encoded authorization failure message

waygee commented 9 years ago

ok, I had to make sure the Amazon IAM user had the correct group access. I used AmazonEC2FullAccess

dimitardanailov commented 9 years ago

@waygee thank you.

denzuko commented 8 years ago

btw in testing, and by convention, an aws Session Token is not a requirement.

bhagerty commented 8 years ago

Since Session Token is not required (and I can verify this, having spun up a machine without a Session Token), shouldn't the reference to a Session Token be removed from the Readme? Or shouldn't the Readme at least say that the Session Token is not required?

Alternatively or additionally, is there some reason for using a Session Token that should be explained somewhere?