diff --git a/saltcloud/clouds/ec2.py b/saltcloud/clouds/ec2.py
index <HASH>..<HASH> 100644
--- a/saltcloud/clouds/ec2.py
+++ b/saltcloud/clouds/ec2.py
@@ -612,6 +612,9 @@ def create(vm_=None, call=None):
                     key_filename=__opts__['EC2.private_key']):
                 username = user
                 break
+        else:
+            return {vm_['name']: 'Failed to authenticate'}
+
     sudo = True
     if 'sudo' in vm_.keys():
         sudo = vm_['sudo']
Fix `UnboundLocalError` when failed to authenticated using SSH with EC2.