Closed mhavu closed 7 years ago
Turns out the following works:
config.vm.define 'foo' do |foo|
foo.vm.box = "foo"
foo.vm.provider :aws do |aws|
aws.instance_type = "t2.micro"
aws.aws_profile = "foo"
aws.keypair_name = "foo"
end
end
config.vm.define 'bar' do |bar|
bar.vm.box = "bar"
bar.vm.provider :aws do |aws|
aws.instance_type = "t2.micro"
aws.aws_profile = "bar"
aws.keypair_name = "bar"
end
end
Is there a way to put the common parts (instance_type
) in a single place?
I have two AWS configurations, foo and bar, and two Vagrant boxes with corresponding names, created with Packer. I can bring them up with
or the same for bar. However, I would like to use a multi-machine setup.
For some reason, the following fails as if the AWS configuration was invalid:
(I get the following error:
Giving aws.access_key_id, aws.secret_access_key, and aws.region in the Vagrantfile doesn't help either. I'm using Vagrant 1.9.2 and AWS plugin version 0.7.2.)
How can I define a multi-machine AWS environment?