diff --git a/lib/kitchen/driver/ec2.rb b/lib/kitchen/driver/ec2.rb index 64fdc5a7..75fd7d4b 100644 --- a/lib/kitchen/driver/ec2.rb +++ b/lib/kitchen/driver/ec2.rb @@ -262,11 +262,11 @@ def create(state) instance.transport.connection(state).wait_until_ready 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)