Skip to content

Commit

Permalink
feat: add network_firewall_policy_enforcement_order network argument
Browse files Browse the repository at this point in the history
  • Loading branch information
Esanim committed Mar 1, 2024
1 parent 6e49cfa commit 4966155
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 15 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ See [variables.tf] and [examples/] for details and use-cases.

Default is `"1460"`.

- [**`network_firewall_policy_enforcement_order`**](#var-network_firewall_policy_enforcement_order): *(Optional `string`)*<a name="var-network_firewall_policy_enforcement_order"></a>

Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is AFTER_CLASSIC_FIREWALL. Possible values are: BEFORE_CLASSIC_FIREWALL, AFTER_CLASSIC_FIREWALL.

Default is `null`.

- [**`enable_ula_internal_ipv6`**](#var-enable_ula_internal_ipv6): *(Optional `bool`)*<a name="var-enable_ula_internal_ipv6"></a>

Enable ULA internal ipv6 on this network. Enabling this feature will assign a `/48` from Google defined ULA prefix `fd20::/20`.
Expand Down
8 changes: 8 additions & 0 deletions README.tfdoc.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ section {
END
}

variable "network_firewall_policy_enforcement_order" {
type = string
default = null
description = <<-END
Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is AFTER_CLASSIC_FIREWALL. Possible values are: BEFORE_CLASSIC_FIREWALL, AFTER_CLASSIC_FIREWALL.
END
}

variable "enable_ula_internal_ipv6" {
type = bool
default = false
Expand Down
13 changes: 7 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ resource "google_compute_network" "vpc" {
description = var.description
project = var.project

auto_create_subnetworks = var.auto_create_subnetworks
routing_mode = var.routing_mode
mtu = var.mtu
delete_default_routes_on_create = var.delete_default_routes_on_create
enable_ula_internal_ipv6 = var.enable_ula_internal_ipv6
internal_ipv6_range = var.internal_ipv6_range
auto_create_subnetworks = var.auto_create_subnetworks
routing_mode = var.routing_mode
mtu = var.mtu
delete_default_routes_on_create = var.delete_default_routes_on_create
enable_ula_internal_ipv6 = var.enable_ula_internal_ipv6
internal_ipv6_range = var.internal_ipv6_range
network_firewall_policy_enforcement_order = var.network_firewall_policy_enforcement_order

depends_on = [var.module_depends_on]
}
19 changes: 10 additions & 9 deletions test/unit-complete/main.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
module "test" {
source = "../.."

project = local.project_id
name = "vpc-unit-complete"
description = "This is a unit test"
routing_mode = "GLOBAL"
delete_default_routes_on_create = true
auto_create_subnetworks = true
mtu = 1500
enable_ula_internal_ipv6 = true
internal_ipv6_range = "fd20:fff:ffff:ffff:ffff:ffff:ffff:ffff"
project = local.project_id
name = "vpc-unit-complete"
description = "This is a unit test"
routing_mode = "GLOBAL"
delete_default_routes_on_create = true
auto_create_subnetworks = true
mtu = 1500
enable_ula_internal_ipv6 = true
internal_ipv6_range = "fd20:fff:ffff:ffff:ffff:ffff:ffff:ffff"
network_firewall_policy_enforcement_order = "BEFORE_CLASSIC_FIREWALL"
}
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ variable "auto_create_subnetworks" {
default = false
}

variable "network_firewall_policy_enforcement_order" {
description = "(Optional) Set the order that Firewall Rules and Firewall Policies are evaluated. Default value is AFTER_CLASSIC_FIREWALL. Possible values are: BEFORE_CLASSIC_FIREWALL, AFTER_CLASSIC_FIREWALL."
type = string
default = null
}

variable "mtu" {
description = "(Optional) Maximum Transmission Unit in bytes. The minimum value for this field is 1460 and the maximum value is 1500 bytes. Default is '1460'."
type = string
Expand Down

0 comments on commit 4966155

Please sign in to comment.