Skip to content

Commit 3ca6e5e

Browse files
feat(TPG>6.42)!: Add policy_type variable to network firewall policy (#657)
Co-authored-by: Imran Nayer <imrannayer@google.com>
1 parent c0b32b1 commit 3ca6e5e

File tree

9 files changed

+38
-13
lines changed

9 files changed

+38
-13
lines changed

docs/upgrading_to_v14.0.0.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Upgrading to v14.0.0
2+
3+
The v14.0 release contains backwards-incompatible changes.
4+
5+
This update requires upgrading:
6+
- minimum provider version of `hashicorp/google` to `6.42` for network-firewall-policy sub-module.

modules/network-connectivity-center/metadata.display.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ spec:
3434
hybrid_spokes:
3535
name: hybrid_spokes
3636
title: Hybrid Spokes
37+
ncc_groups:
38+
name: ncc_groups
39+
title: Ncc Groups
3740
ncc_hub_description:
3841
name: ncc_hub_description
3942
title: Ncc Hub Description
@@ -43,6 +46,12 @@ spec:
4346
ncc_hub_name:
4447
name: ncc_hub_name
4548
title: Ncc Hub Name
49+
ncc_hub_policy_mode:
50+
name: ncc_hub_policy_mode
51+
title: Ncc Hub Policy Mode
52+
ncc_hub_preset_topology:
53+
name: ncc_hub_preset_topology
54+
title: Ncc Hub Preset Topology
4655
project_id:
4756
name: project_id
4857
title: Project Id

modules/network-firewall-policy/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ module "network_firewall_policy" {
134134
| description | An optional description of this resource. Provide this property when you create the resource | `string` | `null` | no |
135135
| policy\_name | User-provided name of the Network firewall policy | `string` | n/a | yes |
136136
| policy\_region | Location of the firewall policy. Needed for regional firewall policies. Default is null (Global firewall policy) | `string` | `null` | no |
137+
| policy\_type | Policy type is used to determine which resources (networks) the policy can be associated with. A policy can be associated with a network only if the network has the matching policyType in its network profile. Different policy types may support some of the Firewall Rules features. Possible values are: VPC\_POLICY, RDMA\_ROCE\_POLICY. | `string` | `null` | no |
137138
| project\_id | Project ID of the Network firewall policy | `string` | n/a | yes |
138139
| rules | List of Ingress/Egress rules | <pre>list(object({<br> priority = number<br> direction = string<br> action = string<br> rule_name = optional(string)<br> disabled = optional(bool)<br> description = optional(string)<br> enable_logging = optional(bool)<br> target_secure_tags = optional(list(string))<br> target_service_accounts = optional(list(string))<br> match = object({<br> src_ip_ranges = optional(list(string), [])<br> src_fqdns = optional(list(string), [])<br> src_region_codes = optional(list(string), [])<br> src_secure_tags = optional(list(string), [])<br> src_threat_intelligences = optional(list(string), [])<br> src_address_groups = optional(list(string), [])<br> dest_ip_ranges = optional(list(string), [])<br> dest_fqdns = optional(list(string), [])<br> dest_region_codes = optional(list(string), [])<br> dest_threat_intelligences = optional(list(string), [])<br> dest_address_groups = optional(list(string), [])<br> layer4_configs = optional(list(object({<br> ip_protocol = optional(string, "all")<br> ports = optional(list(string), [])<br> })), [{}])<br> })<br> is_mirroring = optional(bool, false)<br> tls_inspect = optional(bool, false)<br> security_profile_group_id = optional(string)<br> src_networks = optional(list(string), [])<br> src_network_scope = optional(string)<br> dest_network_scope = optional(string)<br> }))</pre> | `[]` | no |
139140
| target\_vpcs | List of target VPC IDs that the firewall policy will be attached to | `list(string)` | `[]` | no |

modules/network-firewall-policy/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ resource "google_compute_network_firewall_policy" "fw_policy" {
2626
name = var.policy_name
2727
project = var.project_id
2828
description = var.description
29+
policy_type = var.policy_type
2930
}
3031

3132
resource "google_compute_network_firewall_policy_association" "vpc_associations" {
@@ -143,6 +144,7 @@ resource "google_compute_region_network_firewall_policy" "fw_policy" {
143144
project = var.project_id
144145
description = var.description
145146
region = var.policy_region
147+
policy_type = var.policy_type
146148
}
147149

148150
resource "google_compute_region_network_firewall_policy_association" "vpc_associations" {

modules/network-firewall-policy/metadata.display.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ spec:
3737
policy_region:
3838
name: policy_region
3939
title: Policy Region
40+
policy_type:
41+
name: policy_type
42+
title: Policy Type
4043
project_id:
4144
name: project_id
4245
title: Project Id

modules/network-firewall-policy/metadata.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ spec:
114114
- name: policy_region
115115
description: Location of the firewall policy. Needed for regional firewall policies. Default is null (Global firewall policy)
116116
varType: string
117+
- name: policy_type
118+
description: "Policy type is used to determine which resources (networks) the policy can be associated with. A policy can be associated with a network only if the network has the matching policyType in its network profile. Different policy types may support some of the Firewall Rules features. Possible values are: VPC_POLICY, RDMA_ROCE_POLICY."
119+
varType: string
117120
- name: rules
118121
description: List of Ingress/Egress rules
119122
varType: |-

modules/network-firewall-policy/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ variable "policy_region" {
4646
default = null
4747
}
4848

49+
variable "policy_type" {
50+
description = "Policy type is used to determine which resources (networks) the policy can be associated with. A policy can be associated with a network only if the network has the matching policyType in its network profile. Different policy types may support some of the Firewall Rules features. Possible values are: VPC_POLICY, RDMA_ROCE_POLICY."
51+
type = string
52+
default = null
53+
}
54+
4955
variable "rules" {
5056
description = "List of Ingress/Egress rules"
5157
type = list(object({

modules/network-firewall-policy/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ terraform {
2020
required_providers {
2121
google = {
2222
source = "hashicorp/google"
23-
version = ">= 6.28, < 8"
23+
version = ">= 6.42, < 8"
2424
}
2525
google-beta = {
2626
source = "hashicorp/google-beta"
27-
version = ">= 6.28, < 8"
27+
version = ">= 6.42, < 8"
2828
}
2929
}
3030

modules/private-service-connect-producer/metadata.display.yaml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ spec:
4040
name: consumer_accept_lists
4141
title: Consumer Accept Lists
4242
properties:
43+
connection_limit:
44+
name: connection_limit
45+
title: Connection Limit
46+
network_url:
47+
name: network_url
48+
title: Network URL
4349
project_id_or_num:
4450
name: project_id_or_num
4551
title: Project ID or Number
4652
regexValidation: (^[a-z]([-a-z0-9]*[a-z0-9])?)|(^[0-9]{1,12}$)
4753
validation: Must be a valid Google Cloud project ID or number.
48-
network_url:
49-
name: network_url
50-
title: Network URL
51-
connection_limit:
52-
name: connection_limit
53-
title: Connection Limit
5454
consumer_reject_lists:
5555
name: consumer_reject_lists
5656
title: Consumer Reject Lists
@@ -69,11 +69,6 @@ spec:
6969
name: nat_subnets
7070
title: Nat Subnets
7171
properties:
72-
subnet_name:
73-
name: subnet_name
74-
title: Subnet Name
75-
regexValidation: ^[a-z]([a-z0-9-]{0,61}[a-z0-9])?
76-
validation: Use lowercase letters, numbers, and hyphens. Must start with a letter. If longer than 1 character, it must end with a letter or number. Maximum length is 63 characters.
7772
ipv4_range:
7873
name: ipv4_range
7974
title: IPv4 Range

0 commit comments

Comments
 (0)