Skip to content

Commit

Permalink
Add network_profile setting to network, update network resource provider
Browse files Browse the repository at this point in the history
  • Loading branch information
cdunbar13 committed Nov 19, 2024
1 parent d017e2f commit 0387ad1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module "vpc" {
enable_ipv6_ula = var.enable_ipv6_ula
internal_ipv6_range = var.internal_ipv6_range
network_firewall_policy_enforcement_order = var.network_firewall_policy_enforcement_order
network_profile = var.network_profile
}

/******************************************
Expand Down
2 changes: 2 additions & 0 deletions modules/vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
VPC configuration
*****************************************/
resource "google_compute_network" "network" {
provider = google-beta
name = var.network_name
auto_create_subnetworks = var.auto_create_subnetworks
routing_mode = var.routing_mode
Expand All @@ -28,6 +29,7 @@ resource "google_compute_network" "network" {
enable_ula_internal_ipv6 = var.enable_ipv6_ula
internal_ipv6_range = var.internal_ipv6_range
network_firewall_policy_enforcement_order = var.network_firewall_policy_enforcement_order
network_profile = var.network_profile
}

/******************************************
Expand Down
12 changes: 12 additions & 0 deletions modules/vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,15 @@ variable "network_firewall_policy_enforcement_order" {
default = null
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`)"
}

variable "network_profile" {
type = string
default = null
description = <<-EOT
"A full or partial URL of the network profile to apply to this network.
This field can be set only at resource creation time. For example, the
following are valid URLs:
* https://www.googleapis.com/compute/beta/projects/{projectId}/global/networkProfiles/{network_profile_name}
* projects/{projectId}/global/networkProfiles/{network_profile_name}
EOT
}
2 changes: 1 addition & 1 deletion modules/vpc/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ terraform {
}
google-beta = {
source = "hashicorp/google-beta"
version = ">= 4.64, < 7"
version = ">= 6.XX, < 7" # TODO Update this once the provider is released (DO NOT MERGE)
}
}

Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,15 @@ variable "network_firewall_policy_enforcement_order" {
default = null
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`)"
}

variable "network_profile" {
type = string
default = null
description = <<-EOT
"A full or partial URL of the network profile to apply to this network.
This field can be set only at resource creation time. For example, the
following are valid URLs:
* https://www.googleapis.com/compute/beta/projects/{projectId}/global/networkProfiles/{network_profile_name}
* projects/{projectId}/global/networkProfiles/{network_profile_name}
EOT
}

0 comments on commit 0387ad1

Please sign in to comment.