From 2623cee8a76280465f178dfedba37e1ef8efa77b Mon Sep 17 00:00:00 2001 From: devalih Date: Thu, 23 Oct 2014 16:14:51 +0300 Subject: [PATCH 1/2] Support AWS in addition to VirtualBox --- .gitignore | 1 + Vagrantfile | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/.gitignore b/.gitignore index 4089da71..5b386c6d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ data/provisioning.txt data/packages/* !data/packages/README.md +/.idea diff --git a/Vagrantfile b/Vagrantfile index 2718425b..169c5542 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -20,6 +20,34 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vb.gui = true end + config.vm.provider :aws do |aws, override| + aws.access_key_id = "" + aws.secret_access_key = "" + aws.keypair_name = "vagrant" + + + # http://cloud-images.ubuntu.com/locator/ec2/ + aws.ami = "ami-ecda6c84" # ubuntu 12.04 64 + + # This one is a 2 years old experiment so it might not be so good + # http://cloud.ubuntu.com/2012/05/ready-to-try-arm-on-the-cloud-try-it-on-amazon-ec2/ + # aws.ami = "ami-aef328c7" # ubuntu 12.04 arm image + + + + aws.region = "us-east-1" + aws.instance_type = "m3.medium" + + aws.security_groups = ["Widely open"] + aws.tags = { + 'Name' => 'x2go', + } + override.ssh.username = "ubuntu" + override.ssh.private_key_path = "/home/ali/Downloads/vagrant.pem" + override.vm.box = "dummy" + override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box" + end + # Disable automatic box update checking. If you disable this, then # boxes will only be checked for updates when the user runs # `vagrant box outdated`. This is not recommended. From 7dc13b0f0bf694227966e4847839a109ee8c3d71 Mon Sep 17 00:00:00 2001 From: devalih Date: Thu, 23 Oct 2014 16:55:26 +0300 Subject: [PATCH 2/2] Now it gets the aws auth from env --- Vagrantfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 169c5542..5160a437 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -21,9 +21,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| end config.vm.provider :aws do |aws, override| - aws.access_key_id = "" - aws.secret_access_key = "" - aws.keypair_name = "vagrant" + aws.access_key_id = ENV['AWS_KEY'] + aws.secret_access_key = ENV['AWS_SECRET'] + aws.keypair_name = ENV['AWS_KEYNAME'] + override.ssh.private_key_path = ENV['AWS_KEYPATH'] # http://cloud-images.ubuntu.com/locator/ec2/ @@ -38,12 +39,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| aws.region = "us-east-1" aws.instance_type = "m3.medium" - aws.security_groups = ["Widely open"] + aws.security_groups = ["Widely open"] # you have to add this security group on the selected region aws.tags = { 'Name' => 'x2go', } override.ssh.username = "ubuntu" - override.ssh.private_key_path = "/home/ali/Downloads/vagrant.pem" override.vm.box = "dummy" override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box" end