Skip to content

Commit 0387ad1

Browse files
committed
Add network_profile setting to network, update network resource provider
1 parent d017e2f commit 0387ad1

File tree

5 files changed

+28
-1
lines changed

5 files changed

+28
-1
lines changed

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module "vpc" {
3030
enable_ipv6_ula = var.enable_ipv6_ula
3131
internal_ipv6_range = var.internal_ipv6_range
3232
network_firewall_policy_enforcement_order = var.network_firewall_policy_enforcement_order
33+
network_profile = var.network_profile
3334
}
3435

3536
/******************************************

modules/vpc/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
VPC configuration
1919
*****************************************/
2020
resource "google_compute_network" "network" {
21+
provider = google-beta
2122
name = var.network_name
2223
auto_create_subnetworks = var.auto_create_subnetworks
2324
routing_mode = var.routing_mode
@@ -28,6 +29,7 @@ resource "google_compute_network" "network" {
2829
enable_ula_internal_ipv6 = var.enable_ipv6_ula
2930
internal_ipv6_range = var.internal_ipv6_range
3031
network_firewall_policy_enforcement_order = var.network_firewall_policy_enforcement_order
32+
network_profile = var.network_profile
3133
}
3234

3335
/******************************************

modules/vpc/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,15 @@ variable "network_firewall_policy_enforcement_order" {
7777
default = null
7878
description = "Set the order that Firewall Rules and Firewall Policies are evaluated. Valid values are `BEFORE_CLASSIC_FIREWALL` and `AFTER_CLASSIC_FIREWALL`. (default null or equivalent to `AFTER_CLASSIC_FIREWALL`)"
7979
}
80+
81+
variable "network_profile" {
82+
type = string
83+
default = null
84+
description = <<-EOT
85+
"A full or partial URL of the network profile to apply to this network.
86+
This field can be set only at resource creation time. For example, the
87+
following are valid URLs:
88+
* https://www.googleapis.com/compute/beta/projects/{projectId}/global/networkProfiles/{network_profile_name}
89+
* projects/{projectId}/global/networkProfiles/{network_profile_name}
90+
EOT
91+
}

modules/vpc/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ terraform {
2424
}
2525
google-beta = {
2626
source = "hashicorp/google-beta"
27-
version = ">= 4.64, < 7"
27+
version = ">= 6.XX, < 7" # TODO Update this once the provider is released (DO NOT MERGE)
2828
}
2929
}
3030

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,15 @@ variable "network_firewall_policy_enforcement_order" {
199199
default = null
200200
description = "Set the order that Firewall Rules and Firewall Policies are evaluated. Valid values are `BEFORE_CLASSIC_FIREWALL` and `AFTER_CLASSIC_FIREWALL`. (default null or equivalent to `AFTER_CLASSIC_FIREWALL`)"
201201
}
202+
203+
variable "network_profile" {
204+
type = string
205+
default = null
206+
description = <<-EOT
207+
"A full or partial URL of the network profile to apply to this network.
208+
This field can be set only at resource creation time. For example, the
209+
following are valid URLs:
210+
* https://www.googleapis.com/compute/beta/projects/{projectId}/global/networkProfiles/{network_profile_name}
211+
* projects/{projectId}/global/networkProfiles/{network_profile_name}
212+
EOT
213+
}

0 commit comments

Comments
 (0)