I am new to Vagrant and currently trying out provision a VirtualBox and AWS box(using vagrant-aws plugin) from single Vagrantfile.
My Vagrantfile is as shown below:
Vagrant.configure("2") do |config|
config.vm.define :web do |web_config|
web_config.vm.box = "dummy"
web_config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
web_config.vm.provider :aws do |aws|
aws.access_key_id = "ACCESS KEY"
aws.secret_access_key = "SECRET KEY"
end
end
config.vm.define :db do |db_config|
db_config.vm.box = "precise32"
db_config.vm.box_url = "http://files.vagrantup.com/precise32.box"
db_config.vm.provider :virtualbox do |vb|
end
end
end
So basically I am trying to have AWS for web and a network box for database. Is it possible to do this from single Vagrantfile? And will the below vagrant up command create and provision both VMs?
vagrant up --provider=aws