3
votes

I'm new to both Vagrant and AWS but trying to get the two to play together.

I'm following the instructions here, but something doesn't seem correct.

So far my steps are :

  1. List item
  2. Log into AWS Console
  3. Go into IAM
  4. Create user vagrant_test
  5. Downloaded credentials.csv
  6. Edit user vagrant_test Attach policies :
  7. AmazonRDSFullAccess
  8. AmazonEC2FullAccess
  9. AmazonS3FullAccess
  10. AmazonRoute53FullAccess
  11. Go to Services -> EC2
  12. Create Key Pair called vagrant_kp
  13. Download vagrant_kp.pem
  14. Install Vagrant on local machine vagrant plugin install vagrant-aws
  15. Add the dummy box vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box
  16. Check to see if box is installed $ vagrant box list dummy (aws, 0)
  17. Create Vagrantfile with contents

    Vagrant.configure(2) do |config|
      config.vm.box = "dummy"
    
      config.vm.provider :aws do |aws, override|
      aws.access_key_id = "<hidden>"
      aws.secret_access_key = "<hidden>"
      aws.keypair_name = "vagrant_kp"
      aws.ami = "ami-52978200"
      #Amazon Linux AMI 2015.09 (HVM), SSD Volume Type - ami-52978200
      override.ssh.username = "ec2-user"
      override.ssh.private_key_path = "/Users/delOne/Test/re/aws/vagrant_kp.pem"
    
      end
    
    end
    

Now whenever I run Vagrant as vagrant up —-provider=aws, I always get the following message:

The machine with the name '—-provider=aws' was not found configured for this Vagrant environment.

Now I'm not sure what's causing that message.

Would anyone know what's going on here?

2

2 Answers

1
votes

you would need to add the vagrant-aws plugin

vagrant plugin install vagrant-aws

then you can run

vagrant up --provider=aws

If you already had installed the plugin, try to uninstall first and reinstall

vagrant plugin uninstall vagrant-aws 
vagrant plugin install vagrant-aws
0
votes

I was having the same problem with vagrant up —-provider=aws

I ended up doing this:

export VAGRANT_DEFAULT_PROVIDER=aws
vagrant up