PaloAltoNetworks / terraform-aws-swfw-modules

Terraform Reusable Modules for Software Firewalls on AWS
https://registry.terraform.io/modules/PaloAltoNetworks/swfw-modules/aws
MIT License
14 stars 11 forks source link

fix: Fix creating routes for sourced subnets #51

Closed acelebanski closed 5 months ago

acelebanski commented 5 months ago

Description

This PR fixes an unique_route_table_ids output in subnet_set module, which took the value directly from route table resource block. Meanwhile, the route table can also be sourced using a data source block. Now the output takes value from a local which takes value from a resource block or data source block depending on a create type variable.

Motivation and Context

Routes for the subnets that were sourced in the code (using data source blocks) were not created in their respective route tables. Basically the vpc_route module failed to fetch the Route Table IDs from subnet_set module when the subnets were sourced.

How Has This Been Tested?

This has been tested locally from my workstation, with a local copy of the module.

Types of changes

Checklist

sebastianczech commented 5 months ago

Nice improvements, it will help a lot, when customer has already VPCs with subnets, thanks 👍