From 4a0715f9751acd7c9d60284588f16bf02bdb4367 Mon Sep 17 00:00:00 2001 From: Ken Evensen Date: Mon, 22 Jul 2019 14:42:49 -0400 Subject: [PATCH 1/4] Added description and auto_create_subnetworks variables. Signed-off-by: Ken Evensen --- README.md | 2 ++ main.tf | 3 ++- variables.tf | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a06ed89..e88c858f 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,9 @@ Then perform the following commands on the root folder: | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| +| auto\_create\_subnetworks | When set to true, the network is created in 'auto subnet mode' and it will create a subnet for each region automatically across the 10.128.0.0/9 address range. When set to false, the network is created in 'custom subnet mode' so the user can explicitly connect subnetwork resources. | string | `"false"` | no | | delete\_default\_internet\_gateway\_routes | If set, ensure that all routes within the network specified whose names begin with 'default-route' and with a next hop of 'default-internet-gateway' are deleted | string | `"false"` | no | +| description | An optional description of this resource. The resource must be recreated to modify this field. | string | `""` | no | | network\_name | The name of the network being created | string | n/a | yes | | project\_id | The ID of the project where this VPC will be created | string | n/a | yes | | routes | List of routes being created in this VPC | list(map(string)) | `` | no | diff --git a/main.tf b/main.tf index 05b3469a..3eb07983 100644 --- a/main.tf +++ b/main.tf @@ -19,9 +19,10 @@ *****************************************/ resource "google_compute_network" "network" { name = var.network_name - auto_create_subnetworks = "false" + auto_create_subnetworks = var.auto_create_subnetworks routing_mode = var.routing_mode project = var.project_id + description = var.description } /****************************************** diff --git a/variables.tf b/variables.tf index 5f76f164..e0366aa8 100644 --- a/variables.tf +++ b/variables.tf @@ -54,3 +54,14 @@ variable "delete_default_internet_gateway_routes" { description = "If set, ensure that all routes within the network specified whose names begin with 'default-route' and with a next hop of 'default-internet-gateway' are deleted" default = "false" } + + +variable "description" { + description = "An optional description of this resource. The resource must be recreated to modify this field." + default = "" +} + +variable "auto_create_subnetworks" { + description = "When set to true, the network is created in 'auto subnet mode' and it will create a subnet for each region automatically across the 10.128.0.0/9 address range. When set to false, the network is created in 'custom subnet mode' so the user can explicitly connect subnetwork resources." + default = "false" +} From b951e12377de86f9e961064250c27ecf1517160a Mon Sep 17 00:00:00 2001 From: Ken Evensen Date: Mon, 22 Jul 2019 15:20:10 -0400 Subject: [PATCH 2/4] Explicitly defining the type of 'description' --- variables.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/variables.tf b/variables.tf index e0366aa8..fa7b0c64 100644 --- a/variables.tf +++ b/variables.tf @@ -57,6 +57,7 @@ variable "delete_default_internet_gateway_routes" { variable "description" { + type = string description = "An optional description of this resource. The resource must be recreated to modify this field." default = "" } From 3dabbd1bf4f469715c45a7bb75228eeea4f9502f Mon Sep 17 00:00:00 2001 From: Ken Evensen Date: Mon, 22 Jul 2019 15:21:51 -0400 Subject: [PATCH 3/4] Explicitly set type as bool --- variables.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index fa7b0c64..d99ded36 100644 --- a/variables.tf +++ b/variables.tf @@ -63,6 +63,7 @@ variable "description" { } variable "auto_create_subnetworks" { + type = bool description = "When set to true, the network is created in 'auto subnet mode' and it will create a subnet for each region automatically across the 10.128.0.0/9 address range. When set to false, the network is created in 'custom subnet mode' so the user can explicitly connect subnetwork resources." - default = "false" + default = false } From c1dd06cbda8ce411928d39e4cc39ed3120357998 Mon Sep 17 00:00:00 2001 From: Ken Evensen Date: Mon, 22 Jul 2019 19:23:26 -0400 Subject: [PATCH 4/4] Fixes per aaron-lane --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index d99ded36..5e9215ab 100644 --- a/variables.tf +++ b/variables.tf @@ -57,7 +57,7 @@ variable "delete_default_internet_gateway_routes" { variable "description" { - type = string + type = string description = "An optional description of this resource. The resource must be recreated to modify this field." default = "" }