Ignore main route table association when determining which associations to remove. (#23781)
They can't be removed anyway, and will just throw an error if you try to disassociate them.
This commit is contained in:
parent
cc72dead45
commit
4ec8744b8b
1 changed files with 3 additions and 1 deletions
|
@ -404,6 +404,8 @@ def ensure_subnet_association(vpc_conn, vpc_id, route_table_id, subnet_id,
|
|||
if route_table.id is None:
|
||||
continue
|
||||
for a in route_table.associations:
|
||||
if a.main:
|
||||
continue
|
||||
if a.subnet_id == subnet_id:
|
||||
if route_table.id == route_table_id:
|
||||
return {'changed': False, 'association_id': a.id}
|
||||
|
@ -418,7 +420,7 @@ def ensure_subnet_association(vpc_conn, vpc_id, route_table_id, subnet_id,
|
|||
|
||||
def ensure_subnet_associations(vpc_conn, vpc_id, route_table, subnets,
|
||||
check_mode, purge_subnets):
|
||||
current_association_ids = [a.id for a in route_table.associations]
|
||||
current_association_ids = [a.id for a in route_table.associations if not a.main]
|
||||
new_association_ids = []
|
||||
changed = False
|
||||
for subnet in subnets:
|
||||
|
|
Loading…
Reference in a new issue