From f16d8d9afbbf38bc4b9b38b86f477f07b764c93e Mon Sep 17 00:00:00 2001
From: Bret Martin <bret_martin@h3biomedicine.com>
Date: Fri, 6 Mar 2015 14:59:27 -0500
Subject: [PATCH] Allow vpc_subnet_id to remain unspecified (see bc0c169)

---
 cloud/amazon/ec2.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cloud/amazon/ec2.py b/cloud/amazon/ec2.py
index 544f1e8cc84..b59d4bda669 100755
--- a/cloud/amazon/ec2.py
+++ b/cloud/amazon/ec2.py
@@ -785,6 +785,8 @@ def create_instances(module, ec2, vpc, override_count=None):
 
     if vpc_subnet_id:
         vpc_id = vpc.get_all_subnets(subnet_ids=[vpc_subnet_id])[0].vpc_id
+    else:
+        vpc_id = None
 
     try:
         # Here we try to lookup the group id from the security group name - if group is set.