Skip to content

Commit 70949e5

Browse files
authored
Merge pull request #26 from paulpalamarchuk/add_project_id_variable
Added variable "project_id", to replace implicit dependency on provider's project ID
2 parents 12a3a17 + d246bd3 commit 70949e5

File tree

43 files changed

+962
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+962
-191
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Added
1111

12+
- Added variable `project_id`. [#26]
13+
1214
- `preemptible_and_regular_instance_templates` submodule. [#18]
1315
- `mig_with_percent` submodule. [#18]
1416

@@ -42,3 +44,4 @@ project adheres to [Semantic Versioning](http://semver.org/).
4244
[#14]: https://github.com/terraform-google-modules/terraform-google-vm/pull/14
4345
[#16]: https://github.com/terraform-google-modules/terraform-google-vm/pull/16
4446
[#18]: https://github.com/terraform-google-modules/terraform-google-vm/pull/18
47+
[#26]: https://github.com/terraform-google-modules/terraform-google-vm/pull/26

Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ check_golang:
5252
check_terraform:
5353
@source test/make.sh && check_terraform
5454

55-
.PHONY: check_docker
56-
check_docker:
57-
@source test/make.sh && docker
58-
5955
.PHONY: check_base_files
6056
check_base_files:
6157
@source test/make.sh && basefiles

examples/instance_template/additional_disks/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,15 @@
33
This example demonstrates how to use the instance_template module to create
44
instance templates with additional persistent disks.
55

6-
[^]: (autogen_docs_start)
7-
6+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
87
## Inputs
98

109
| Name | Description | Type | Default | Required |
1110
|------|-------------|:----:|:-----:|:-----:|
1211
| credentials\_path | The path to the GCP credentials JSON file | string | n/a | yes |
1312
| project\_id | The GCP project to use for integration tests | string | n/a | yes |
1413
| region | The GCP region to create and test resources in | string | n/a | yes |
15-
| service\_account | Service account email address and scopes | map | n/a | yes |
14+
| service\_account | Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#service_account. | object | `"null"` | no |
1615
| subnetwork | The name of the subnetwork create this instance in. | string | `""` | no |
1716

1817
## Outputs
@@ -22,4 +21,4 @@ instance templates with additional persistent disks.
2221
| name | Name of the instance templates |
2322
| self\_link | Self-link to the instance template |
2423

25-
[^]: (autogen_docs_end)
24+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/instance_template/additional_disks/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ provider "google" {
2323

2424
module "instance_template" {
2525
source = "../../../modules/instance_template"
26+
project_id = var.project_id
2627
subnetwork = var.subnetwork
2728
service_account = var.service_account
2829
name_prefix = "additional-disks"

examples/instance_template/simple/README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22

33
This is a simple, minimal example of how to use the instance_template module.
44

5-
[^]: (autogen_docs_start)
6-
5+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
76
## Inputs
87

98
| Name | Description | Type | Default | Required |
109
|------|-------------|:----:|:-----:|:-----:|
1110
| credentials\_path | The path to the GCP credentials JSON file | string | n/a | yes |
12-
| labels | Labels, provided as a map | map | n/a | yes |
11+
| labels | Labels, provided as a map | map(string) | n/a | yes |
1312
| project\_id | The GCP project to use for integration tests | string | n/a | yes |
1413
| region | The GCP region to create and test resources in | string | n/a | yes |
15-
| service\_account | Service account email address and scopes | map | n/a | yes |
14+
| service\_account | Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#service_account. | object | `"null"` | no |
1615
| subnetwork | The name of the subnetwork create this instance in. | string | `""` | no |
17-
| tags | Network tags, provided as a list | list | n/a | yes |
16+
| tags | Network tags, provided as a list | list(string) | n/a | yes |
1817

1918
## Outputs
2019

@@ -23,4 +22,4 @@ This is a simple, minimal example of how to use the instance_template module.
2322
| name | Name of the instance templates |
2423
| self\_link | Self-link to the instance template |
2524

26-
[^]: (autogen_docs_end)
25+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/instance_template/simple/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ provider "google" {
2323

2424
module "instance_template" {
2525
source = "../../../modules/instance_template"
26+
project_id = var.project_id
2627
subnetwork = var.subnetwork
2728
service_account = var.service_account
2829
name_prefix = "simple"

examples/mig/autoscaler/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
This is an example of how to use the MIG module to create a managed instance
44
group with an autoscaler.
55

6-
[^]: (autogen_docs_start)
7-
6+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
87
## Inputs
98

109
| Name | Description | Type | Default | Required |
1110
|------|-------------|:----:|:-----:|:-----:|
12-
| autoscaling\_cpu | Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute\_autoscaler.html#cpu\_utilization | list | n/a | yes |
11+
| autoscaling\_cpu | Autoscaling, cpu utilization policy block as single element array. https://www.terraform.io/docs/providers/google/r/compute_autoscaler.html#cpu_utilization | list(map(number)) | n/a | yes |
1312
| autoscaling\_enabled | Creates an autoscaler for the managed instance group | string | n/a | yes |
1413
| credentials\_path | The path to the GCP credentials JSON file | string | n/a | yes |
1514
| min\_replicas | The minimum number of replicas that the autoscaler can scale down to. This cannot be less than 0. | string | n/a | yes |
1615
| project\_id | The GCP project to use for integration tests | string | n/a | yes |
1716
| region | The GCP region to create and test resources in | string | n/a | yes |
18-
| service\_account | Service account email address and scopes | map | n/a | yes |
17+
| service\_account | Service account to attach to the instance. See https://www.terraform.io/docs/providers/google/r/compute_instance_template.html#service_account. | object | `"null"` | no |
1918
| subnetwork | The subnetwork to host the compute instances in | string | n/a | yes |
2019

2120
## Outputs
@@ -25,4 +24,4 @@ group with an autoscaler.
2524
| instance\_template\_self\_link | Self-link of instance template |
2625
| mig\_self\_link | Self-link for managed instance group |
2726

28-
[^]: (autogen_docs_end)
27+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/mig/autoscaler/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ provider "google-beta" {
3030

3131
module "instance_template" {
3232
source = "../../../modules/instance_template"
33+
project_id = var.project_id
3334
subnetwork = var.subnetwork
3435
service_account = var.service_account
3536
}
3637

3738
module "mig" {
3839
source = "../../../modules/mig"
40+
project_id = var.project_id
3941
region = var.region
4042
hostname = "mig-autoscaler"
4143
subnetwork = var.subnetwork

examples/mig/full/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ provider "google-beta" {
3131
module "instance_template" {
3232
source = "../../../modules/instance_template"
3333
name_prefix = "${var.hostname}-instance-template"
34+
project_id = var.project_id
3435
machine_type = var.machine_type
3536
tags = var.tags
3637
labels = var.labels
@@ -58,6 +59,7 @@ module "instance_template" {
5859

5960
module "mig" {
6061
source = "../../../modules/mig"
62+
project_id = var.project_id
6163
network = var.network
6264
subnetwork = var.subnetwork
6365
subnetwork_project = var.subnetwork_project

examples/mig/full/variables.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ variable "subnetwork" {
3939

4040
variable "project_id" {
4141
description = "The GCP project to use for integration tests"
42-
default = ""
4342
}
4443

4544
variable "credentials_path" {

0 commit comments

Comments
 (0)