Skip to content

Commit 3dd4e97

Browse files
committed
Remove hard-coded network from examples #33
1 parent 2379374 commit 3dd4e97

File tree

13 files changed

+69
-11
lines changed

13 files changed

+69
-11
lines changed

examples/automatic-labelling-from-localhost/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ this directory:
2222

2323
| Name | Description | Type | Default | Required |
2424
|------|-------------|:----:|:-----:|:-----:|
25+
| network | The name or self_link of the network to create compute instance in. Only one of network or subnetwork should be specified. | string | `""` | no |
2526
| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes |
2627
| region | The region in which resources will be applied. | string | n/a | yes |
28+
| subnetwork | The name or self_link of the subnetwork to create compute instance in. Only one of network or subnetwork should be specified. | string | `""` | no |
2729
| zone | The zone in which resources will be applied. | string | n/a | yes |
2830

2931
## Outputs

examples/automatic-labelling-from-localhost/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ resource "google_compute_instance" "main" {
9090
}
9191

9292
network_interface {
93-
network = "default"
93+
network = var.network
94+
subnetwork = var.subnetwork
9495
}
9596

9697
project = var.project_id

examples/automatic-labelling-from-localhost/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,15 @@ variable "zone" {
2828
type = string
2929
description = "The zone in which resources will be applied."
3030
}
31+
32+
variable "network" {
33+
type = string
34+
description = "The name or self_link of the network to create compute instance in. Only one of network or subnetwork should be specified."
35+
default = ""
36+
}
37+
38+
variable "subnetwork" {
39+
type = string
40+
description = "The name or self_link of the subnetwork to create compute instance in. Only one of network or subnetwork should be specified."
41+
default = ""
42+
}

examples/automatic-labelling-from-repository/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ this directory:
2222

2323
| Name | Description | Type | Default | Required |
2424
|------|-------------|:----:|:-----:|:-----:|
25+
| network | The name or self_link of the network to create compute instance in. Only one of network or subnetwork should be specified. | string | `""` | no |
2526
| project\_id | The ID of the project to which resources will be applied. | string | n/a | yes |
2627
| region | The region in which resources will be applied. | string | n/a | yes |
28+
| subnetwork | The name or self_link of the subnetwork to create compute instance in. Only one of network or subnetwork should be specified. | string | `""` | no |
2729
| zone | The zone in which resources will be applied. | string | n/a | yes |
2830

2931
## Outputs

examples/automatic-labelling-from-repository/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,8 @@ resource "google_compute_instance" "main" {
119119
}
120120

121121
network_interface {
122-
network = "default"
122+
network = var.network
123+
subnetwork = var.subnetwork
123124
}
124125

125126
project = var.project_id

examples/automatic-labelling-from-repository/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,15 @@ variable "zone" {
2828
type = string
2929
description = "The zone in which resources will be applied."
3030
}
31+
32+
variable "network" {
33+
type = string
34+
description = "The name or self_link of the network to create compute instance in. Only one of network or subnetwork should be specified."
35+
default = ""
36+
}
37+
38+
variable "subnetwork" {
39+
type = string
40+
description = "The name or self_link of the subnetwork to create compute instance in. Only one of network or subnetwork should be specified."
41+
default = ""
42+
}

test/fixtures/automatic-labelling-from-localhost/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ module "automatic_labelling_from_localhost" {
1919

2020
project_id = var.project_id
2121
region = var.region
22+
subnetwork = var.subnetwork
2223
zone = var.zone
2324
}

test/fixtures/automatic-labelling-from-localhost/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ variable "zone" {
2828
type = string
2929
description = "The zone in which resources will be applied."
3030
}
31+
32+
variable "subnetwork" {
33+
type = string
34+
description = "The name or self_link of the subnetwork to create compute instance in."
35+
}

test/fixtures/automatic-labelling-from-repository/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ module "automatic_labelling_from_repository" {
1919

2020
project_id = var.project_id
2121
region = var.region
22+
subnetwork = var.subnetwork
2223
zone = var.zone
2324
}

test/fixtures/automatic-labelling-from-repository/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ variable "zone" {
2828
type = string
2929
description = "The zone in which resources will be applied."
3030
}
31+
32+
variable "subnetwork" {
33+
type = string
34+
description = "The name or self_link of the subnetwork to create compute instance in."
35+
}

0 commit comments

Comments
 (0)