Skip to content

Commit 456a6d9

Browse files
authored
feat!: Add network_profile setting to network, update network resource provider (#584)
1 parent d017e2f commit 456a6d9

File tree

8 files changed

+31
-2
lines changed

8 files changed

+31
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Then perform the following commands on the root folder:
117117
| mtu | The network MTU (If set to 0, meaning MTU is unset - defaults to '1460'). Recommended values: 1460 (default for historic reasons), 1500 (Internet default), or 8896 (for Jumbo packets). Allowed are all values in the range 1300 to 8896, inclusively. | `number` | `0` | no |
118118
| network\_firewall\_policy\_enforcement\_order | 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`) | `string` | `null` | no |
119119
| network\_name | The name of the network being created | `string` | n/a | yes |
120+
| network\_profile | "A full or partial URL of the network profile to apply to this network.<br>This field can be set only at resource creation time. For example, the<br>following are valid URLs:<br> * https://www.googleapis.com/compute/beta/projects/{projectId}/global/networkProfiles/{network_profile_name}<br> * projects/{projectId}/global/networkProfiles/{network\_profile\_name} | `string` | `null` | no |
120121
| project\_id | The ID of the project where this VPC will be created | `string` | n/a | yes |
121122
| routes | List of routes being created in this VPC | `list(map(string))` | `[]` | no |
122123
| routing\_mode | The network routing mode (default 'GLOBAL') | `string` | `"GLOBAL"` | no |

docs/upgrading_to_v10.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
The v10.0 release contains backwards-incompatible changes.
44

5-
This update requires upgrading the minimum provider version of `hashicorp/google` from `3.50` to `5.8` and `hashicorp/google-beta` from `3.50` to `5.8`.
5+
This update requires upgrading the minimum provider version of `hashicorp/google` from `3.50` to `5.8` and `hashicorp/google-beta` from `3.50` to `6.13`.

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/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module "vpc" {
3636
| mtu | The network MTU (If set to 0, meaning MTU is unset - defaults to '1460'). Recommended values: 1460 (default for historic reasons), 1500 (Internet default), or 8896 (for Jumbo packets). Allowed are all values in the range 1300 to 8896, inclusively. | `number` | `0` | no |
3737
| network\_firewall\_policy\_enforcement\_order | 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`) | `string` | `null` | no |
3838
| network\_name | The name of the network being created | `string` | n/a | yes |
39+
| network\_profile | "A full or partial URL of the network profile to apply to this network.<br>This field can be set only at resource creation time. For example, the<br>following are valid URLs:<br> * https://www.googleapis.com/compute/beta/projects/{projectId}/global/networkProfiles/{network_profile_name}<br> * projects/{projectId}/global/networkProfiles/{network\_profile\_name} | `string` | `null` | no |
3940
| project\_id | The ID of the project where this VPC will be created | `string` | n/a | yes |
4041
| routing\_mode | The network routing mode (default 'GLOBAL') | `string` | `"GLOBAL"` | no |
4142
| shared\_vpc\_host | Makes this project a Shared VPC host if 'true' (default 'false') | `bool` | `false` | no |

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.13, < 7"
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)