Skip to content

Commit 2b6e105

Browse files
committed
Correct type of create_network variable
1 parent dfea366 commit 2b6e105

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Then perform the following commands on the root folder:
8484
| Name | Description | Type | Default | Required |
8585
|------|-------------|:----:|:-----:|:-----:|
8686
| 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. | bool | `"false"` | no |
87-
| create\_network | Specify whether to create a new network or just assume it already exists. | string | `"true"` | no |
87+
| create\_network | Specify whether to create a new network or just assume it already exists. | bool | `"true"` | no |
8888
| 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 |
8989
| description | An optional description of this resource. The resource must be recreated to modify this field. | string | `""` | no |
9090
| network\_name | The name of the network being created | string | n/a | yes |

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
VPC configuration
1919
*****************************************/
2020
resource "google_compute_network" "network" {
21-
count = var.create_network == "true" ? 1 : 0
21+
count = var.create_network ? 1 : 0
2222
name = var.network_name
2323
auto_create_subnetworks = var.auto_create_subnetworks
2424
routing_mode = var.routing_mode

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ variable "project_id" {
1919
}
2020

2121
variable "create_network" {
22-
type = string
23-
default = "true"
22+
type = bool
23+
default = true
2424
description = "Specify whether to create a new network or just assume it already exists."
2525
}
2626

0 commit comments

Comments
 (0)