Skip to content

Commit 3d342c5

Browse files
committed
set default for custom rules, update README inputs/outputs table
1 parent bcd0a0c commit 3d342c5

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

modules/fabric-net-firewall/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module "net-firewall" {
3636
|------|-------------|:----:|:-----:|:-----:|
3737
| admin\_ranges | IP CIDR ranges that have complete access to all subnets. | list | `<list>` | no |
3838
| admin\_ranges\_enabled | Enable admin ranges-based rules. | string | `"false"` | no |
39+
| custom\_rules | List of custom rule definitions (refer to variables file for syntax). | map | `<map>` | no |
3940
| http\_source\_ranges | List of IP CIDR ranges for tag-based HTTP rule, defaults to 0.0.0.0/0. | list | `<list>` | no |
4041
| https\_source\_ranges | List of IP CIDR ranges for tag-based HTTPS rule, defaults to 0.0.0.0/0. | list | `<list>` | no |
4142
| internal\_allow | Allow rules for internal ranges. | list | `<list>` | no |

modules/fabric-net-firewall/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ resource "google_compute_firewall" "custom" {
120120
source_ranges = each.value.direction == "INGRESS" ? each.value.ranges : null
121121
destination_ranges = each.value.direction == "EGRESS" ? each.value.ranges : null
122122
source_tags = each.value.use_service_accounts || each.value.direction == "EGRESS" ? null : each.value.sources
123-
target_tags = each.value.use_service_accounts ? null : each.value.targets
124123
source_service_accounts = each.value.use_service_accounts && each.value.direction == "INGRESS" ? each.value.sources : null
124+
target_tags = each.value.use_service_accounts ? null : each.value.targets
125125
target_service_accounts = each.value.use_service_accounts ? each.value.targets : null
126126
disabled = lookup(each.value.extra_attributes, "disabled", false)
127127
priority = lookup(each.value.extra_attributes, "priority", 1000)

modules/fabric-net-firewall/variables.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ variable "https_source_ranges" {
6767
}
6868

6969
variable "custom_rules" {
70-
description = "List of custom rule definitions."
70+
description = "List of custom rule definitions (refer to variables file for syntax)."
71+
default = {}
7172
type = map(object({
7273
description = string
7374
direction = string

0 commit comments

Comments
 (0)