included an empty list as default in the ingress_rules.destination_ranges variable
This commit is contained in:
parent
adb88d8a87
commit
4ccf9f9361
|
@ -101,7 +101,8 @@ resource "google_compute_firewall" "custom-rules" {
|
||||||
? ["0.0.0.0/0"]
|
? ["0.0.0.0/0"]
|
||||||
: each.value.source_ranges
|
: each.value.source_ranges
|
||||||
)
|
)
|
||||||
: each.value.source_ranges #for egress, we will include the range only if != null. Previously, always included a null
|
#for egress, we will include the source_ranges when provided. Previously, null was forced
|
||||||
|
: each.value.source_ranges
|
||||||
)
|
)
|
||||||
destination_ranges = (
|
destination_ranges = (
|
||||||
each.value.direction == "EGRESS"
|
each.value.direction == "EGRESS"
|
||||||
|
@ -110,7 +111,8 @@ resource "google_compute_firewall" "custom-rules" {
|
||||||
? ["0.0.0.0/0"]
|
? ["0.0.0.0/0"]
|
||||||
: each.value.destination_ranges
|
: each.value.destination_ranges
|
||||||
)
|
)
|
||||||
: each.value.destination_ranges #for ingress, we will include the range only if != null. Previously, always included a null
|
#for ingress, we will include the destination_ranges when provided. Previously, null was forced
|
||||||
|
: each.value.destination_ranges
|
||||||
)
|
)
|
||||||
source_tags = (
|
source_tags = (
|
||||||
each.value.use_service_accounts || each.value.direction == "EGRESS"
|
each.value.use_service_accounts || each.value.direction == "EGRESS"
|
||||||
|
|
|
@ -71,7 +71,7 @@ variable "ingress_rules" {
|
||||||
type = map(object({
|
type = map(object({
|
||||||
deny = optional(bool, false)
|
deny = optional(bool, false)
|
||||||
description = optional(string)
|
description = optional(string)
|
||||||
destination_ranges = optional(list(string))
|
destination_ranges = optional(list(string), []) # empty list is needed as default to allow deletion after initial creation with a value
|
||||||
disabled = optional(bool, false)
|
disabled = optional(bool, false)
|
||||||
enable_logging = optional(object({
|
enable_logging = optional(object({
|
||||||
include_metadata = optional(bool)
|
include_metadata = optional(bool)
|
||||||
|
|
Loading…
Reference in New Issue