diff --git a/lib/kitchen/driver/ec2.rb b/lib/kitchen/driver/ec2.rb index 04e9a1ab..78af58bd 100644 --- a/lib/kitchen/driver/ec2.rb +++ b/lib/kitchen/driver/ec2.rb @@ -264,11 +264,11 @@ def create(state) attach_network_interface(state) unless config[:elastic_network_interface_id].nil? create_ec2_json(state) if /chef/i.match?(instance.provisioner.name) debug("ec2:create '#{state[:hostname]}'") - rescue Exception + rescue Exception => e # Clean up any auto-created security groups or keys on the way out. delete_security_group(state) delete_key(state) - raise + raise "#{e.message} in the specified region #{config[:region]}. Please check this AMI is available in this region." end def destroy(state)