Skip to content

Commit

Permalink
Tags feature: support tags specification for NAT gateway (solves ansi…
Browse files Browse the repository at this point in the history
…ble-collections#345)

- implements tags feature for NAT gateway
- adds integration test tasks for tags feature
- refactor integration tests (overall) removing hard-coded parameters
- add missing integration test tasks without CHECK_MODE
  • Loading branch information
alinabuzachis committed Jan 26, 2021
1 parent 70fd28f commit acaf280
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions plugins/modules/ec2_vpc_nat_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -811,13 +811,11 @@ def pre_create(client, module, subnet_id, tags, purge_tags, allocation_id=None,
changed = False
err_msg = ""
results = list()

check_input_tags(module, tags)

if not allocation_id and not eip_address:
existing_gateways, allocation_id_exists = (
gateway_in_subnet_exists(client, subnet_id, check_mode=check_mode)
)
existing_gateways, allocation_id_exists = (gateway_in_subnet_exists(client, subnet_id, check_mode=check_mode))
if len(existing_gateways) > 0 and if_exist_do_not_create:
results = existing_gateways[0]
results['tags'], tags_update_exists = ensure_tags(client, module, results['nat_gateway_id'], tags, purge_tags, check_mode)
Expand Down

0 comments on commit acaf280

Please sign in to comment.