An availability zone will be selected if none is provided. Set az to an empty string if it's None to avoid traceback. (#32216)
This commit is contained in:
parent
56efcb1b72
commit
2a42800c44
1 changed files with 3 additions and 0 deletions
|
@ -124,6 +124,9 @@ def subnet_exists(conn, subnet_id):
|
|||
|
||||
def create_subnet(conn, module, vpc_id, cidr, az, check_mode):
|
||||
try:
|
||||
# Specifying the availability zone is optional.
|
||||
if not az:
|
||||
az = ''
|
||||
new_subnet = get_subnet_info(conn.create_subnet(VpcId=vpc_id, CidrBlock=cidr, AvailabilityZone=az))
|
||||
# Sometimes AWS takes its time to create a subnet and so using
|
||||
# new subnets's id to do things like create tags results in
|
||||
|
|
Loading…
Reference in a new issue