Skip to content

Commit 0a6aaa2

Browse files
authored
Merge pull request #57 from kevensen/master
Added description and auto_create_subnetworks variables.
2 parents 4e7cd17 + c1dd06c commit 0a6aaa2

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ Then perform the following commands on the root folder:
8282

8383
| Name | Description | Type | Default | Required |
8484
|------|-------------|:----:|:-----:|:-----:|
85+
| 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 |
8586
| 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 |
87+
| description | An optional description of this resource. The resource must be recreated to modify this field. | string | `""` | no |
8688
| network\_name | The name of the network being created | string | n/a | yes |
8789
| project\_id | The ID of the project where this VPC will be created | string | n/a | yes |
8890
| routes | List of routes being created in this VPC | list(map(string)) | `<list>` | no |

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
*****************************************/
2020
resource "google_compute_network" "network" {
2121
name = var.network_name
22-
auto_create_subnetworks = "false"
22+
auto_create_subnetworks = var.auto_create_subnetworks
2323
routing_mode = var.routing_mode
2424
project = var.project_id
25+
description = var.description
2526
}
2627

2728
/******************************************

variables.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,16 @@ variable "delete_default_internet_gateway_routes" {
5454
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"
5555
default = "false"
5656
}
57+
58+
59+
variable "description" {
60+
type = string
61+
description = "An optional description of this resource. The resource must be recreated to modify this field."
62+
default = ""
63+
}
64+
65+
variable "auto_create_subnetworks" {
66+
type = bool
67+
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."
68+
default = false
69+
}

0 commit comments

Comments
 (0)