Skip to content

Commit 8b98a36

Browse files
authored
feat: Promote role and purpose of subnet to GA (#343)
* add role and purpose * use upgraded syntax * bump version
1 parent 1e2d68a commit 8b98a36

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

examples/multi_vpc/main.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module "test-vpc-module-01" {
7979
]
8080

8181
secondary_ranges = {
82-
"${local.network_01_subnet_01}" = [
82+
(local.network_01_subnet_01) = [
8383
{
8484
range_name = "${local.network_01_subnet_01}-01"
8585
ip_cidr_range = "192.168.64.0/24"
@@ -90,7 +90,7 @@ module "test-vpc-module-01" {
9090
},
9191
]
9292

93-
"${local.network_01_subnet_02}" = [
93+
(local.network_01_subnet_02) = [
9494
{
9595
range_name = "${local.network_02_subnet_01}-01"
9696
ip_cidr_range = "192.168.74.0/24"
@@ -108,14 +108,14 @@ module "test-vpc-module-02" {
108108

109109
subnets = [
110110
{
111-
subnet_name = "${local.network_02_subnet_01}"
111+
subnet_name = local.network_02_subnet_01
112112
subnet_ip = "10.10.40.0/24"
113113
subnet_region = "us-west1"
114114
subnet_private_access = "false"
115115
subnet_flow_logs = "true"
116116
},
117117
{
118-
subnet_name = "${local.network_02_subnet_02}"
118+
subnet_name = local.network_02_subnet_02
119119
subnet_ip = "10.10.50.0/24"
120120
subnet_region = "us-west1"
121121
subnet_private_access = "false"
@@ -124,7 +124,7 @@ module "test-vpc-module-02" {
124124
]
125125

126126
secondary_ranges = {
127-
"${local.network_02_subnet_01}" = [
127+
(local.network_02_subnet_01) = [
128128
{
129129
range_name = "${local.network_02_subnet_02}-01"
130130
ip_cidr_range = "192.168.75.0/24"

examples/secondary_ranges/main.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ module "vpc-secondary-ranges" {
2828

2929
subnets = [
3030
{
31-
subnet_name = "${local.subnet_01}"
31+
subnet_name = local.subnet_01
3232
subnet_ip = "10.10.10.0/24"
3333
subnet_region = "us-west1"
3434
},
3535
{
36-
subnet_name = "${local.subnet_02}"
36+
subnet_name = local.subnet_02
3737
subnet_ip = "10.10.20.0/24"
3838
subnet_region = "us-west1"
3939
subnet_private_access = "true"
4040
subnet_flow_logs = "true"
4141
},
4242
{
43-
subnet_name = "${local.subnet_03}"
43+
subnet_name = local.subnet_03
4444
subnet_ip = "10.10.30.0/24"
4545
subnet_region = "us-west1"
4646
subnet_flow_logs = "true"
@@ -49,14 +49,14 @@ module "vpc-secondary-ranges" {
4949
subnet_flow_logs_metadata = "INCLUDE_ALL_METADATA"
5050
},
5151
{
52-
subnet_name = "${local.subnet_04}"
52+
subnet_name = local.subnet_04
5353
subnet_ip = "10.10.40.0/24"
5454
subnet_region = "us-west1"
5555
},
5656
]
5757

5858
secondary_ranges = {
59-
"${local.subnet_01}" = [
59+
(local.subnet_01) = [
6060
{
6161
range_name = "${local.subnet_01}-01"
6262
ip_cidr_range = "192.168.64.0/24"
@@ -67,9 +67,9 @@ module "vpc-secondary-ranges" {
6767
},
6868
]
6969

70-
"${local.subnet_02}" = []
70+
(local.subnet_02) = []
7171

72-
"${local.subnet_03}" = [
72+
(local.subnet_03) = [
7373
{
7474
range_name = "${local.subnet_03}-01"
7575
ip_cidr_range = "192.168.66.0/24"

examples/simple_project/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# [START vpc_custom_create]
2424
module "test-vpc-module" {
2525
source = "terraform-google-modules/network/google"
26-
version = "~> 3.2.0"
26+
version = "~> 4.0.1"
2727
project_id = var.project_id # Replace this with your project ID in quotes
2828
network_name = "my-custom-mode-network"
2929
mtu = 1460

examples/simple_project/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ terraform {
1919

2020
required_providers {
2121
google = {
22-
version = "~> 3.45.0"
22+
version = "~> 4.0"
2323
}
2424
null = {
2525
version = "~> 2.1"

modules/subnets/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,7 @@ resource "google_compute_subnetwork" "subnetwork" {
5656
)) :
5757
var.secondary_ranges[each.value.subnet_name][i]
5858
]
59+
60+
purpose = lookup(each.value, "purpose", null)
61+
role = lookup(each.value, "role", null)
5962
}

0 commit comments

Comments
 (0)