mitchellh / vagrant-aws

Use Vagrant to manage your EC2 and VPC instances.
MIT License
2.61k stars 573 forks source link

Fail to load :ami setting from Vagrantfile #487

Open tario-yang opened 8 years ago

tario-yang commented 8 years ago

Hi, there,

I installed vagrant-aws 0.7.2 in cloudfoundry/bosh-lite and then tried to setup a VM on AWS via following Vagrantfile,

config.vm.provider :aws do |v, override| override.vm.box_version = '9000.130.0' v.access_key_id = ENV['BOSH_AWS_ACCESS_KEY_ID'] v.ami = "ami-2d39803a" v.instance_type = "m4.large" v.secret_access_key = ENV['BOSH_AWS_SECRET_ACCESS_KEY'] v.subnet_id = ENV['BOSH_AWS_SUBNET_ID'] v.region = ENV['BOSH_AWS_REGION'] v.block_device_mapping = [{ 'DeviceName' => '/dev/sdb1', 'Ebs.VolumeType'=>'gp2', 'Ebs.VolumeSize' => 120, 'VirtualName' => 'ephemeral0' }] v.associate_public_ip = true end

However, it failed due to incorrect ami. The console outputted is

==> default: -- AMI: ami-d00c5cba

but the one set in Vagrantfile is

v.ami = "ami-2d39803a"

Could you help to give me some suggestion?

Notes,

tario-yang commented 8 years ago

Oh, got it,

When using

aws.region_config "us-east-1", :ami => "ami-2d39803a"

the ami setting can be read correctly.