Setup:
git clone [email protected]:nabeken/vagrant-aws.git
cd vagrant-aws
git checkout spot-3
gem build vagrant-aws.gemspec
vagrant install plugin vagrant-aws-0.5.0.gem
Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
config.vm.provider :aws do |aws, override|
aws.instance_type = "c4.large"
aws.keypair_name = "keypair"
aws.ami = "ami-9eaa1cf6"
aws.region = "us-east-1"
aws.subnet_id = "subnet-a1b2c3d4"
aws.tags = {
'Name' => 'name',
'client' => 'client'
}
aws.security_groups = ['sg-a1b2c3d4']
aws.region_config "us-east-1" do |region|
region.spot_instance = true
region.spot_max_price = "0.02"
end
override.ssh.username = "ubuntu"
override.ssh.private_key_path = "keypair.pem"
end
end
Run:
vagrant up --provider=aws
Thanks!