I just ran into this issue a few minutes ago. I would like for there to be an update() method on subnet objects similar to the VPC objects. Here is my solution:
#generic subnet creation method
def create_subnet(connection, vpc, cidr, name, test_mode=True):
print("Creating subnet with CIDR block", cidr)
subnet = connection.create_subnet(vpc.id, cidr_block=cidr, dry_run=test_mode)
#wait for subnet to become live
while subnet.state == 'pending':
subnets = connection.get_all_subnets()
for item in subnets:
if item.id == subnet.id:
subnet.state = item.state
time.sleep(5)
#tag the subnet
subnet.add_tag("Name", name)
print("Done")
return subnet