Skip to content

Commit ba8884e

Browse files
committed
Fix testing approach. Update examples, tests. Remove make_source.sh, terraform_docs, terraform_validate helpers.
1 parent cc9ee9c commit ba8884e

File tree

58 files changed

+100
-952
lines changed

Some content is hidden

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

58 files changed

+100
-952
lines changed

examples/compute_instance/simple/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
provider "google" {
18-
credentials = file(var.credentials_path)
18+
1919
project = var.project_id
2020
region = var.region
2121
version = "~> 2.7.0"

examples/compute_instance/simple/variables.tf

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Google LLC
2+
* Copyright 2019 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,16 +14,17 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "credentials_path" {
18-
description = "The path to the GCP credentials JSON file"
19-
}
17+
2018

2119
variable "project_id" {
2220
description = "The GCP project to use for integration tests"
21+
type = string
2322
}
2423

2524
variable "region" {
2625
description = "The GCP region to create and test resources in"
26+
type = string
27+
default = "us-central1"
2728
}
2829

2930
variable "subnetwork" {
@@ -34,6 +35,8 @@ variable "num_instances" {
3435
description = "Number of instances to create"
3536
}
3637

38+
39+
3740
variable "service_account" {
3841
default = null
3942
type = object({

examples/instance_template/additional_disks/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
provider "google" {
18-
credentials = file(var.credentials_path)
18+
1919
project = var.project_id
2020
region = var.region
2121
version = "~> 2.7.0"

examples/instance_template/additional_disks/variables.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Google LLC
2+
* Copyright 2019 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,16 +14,17 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "credentials_path" {
18-
description = "The path to the GCP credentials JSON file"
19-
}
17+
2018

2119
variable "project_id" {
2220
description = "The GCP project to use for integration tests"
21+
type = string
2322
}
2423

2524
variable "region" {
2625
description = "The GCP region to create and test resources in"
26+
type = string
27+
default = "us-central1"
2728
}
2829

2930
variable "subnetwork" {

examples/instance_template/simple/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
provider "google" {
18-
credentials = file(var.credentials_path)
18+
1919
project = var.project_id
2020
region = var.region
2121
version = "~> 2.7.0"

examples/instance_template/simple/variables.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Google LLC
2+
* Copyright 2019 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,16 +14,17 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "credentials_path" {
18-
description = "The path to the GCP credentials JSON file"
19-
}
17+
2018

2119
variable "project_id" {
2220
description = "The GCP project to use for integration tests"
21+
type = string
2322
}
2423

2524
variable "region" {
2625
description = "The GCP region to create and test resources in"
26+
type = string
27+
default = "us-central1"
2728
}
2829

2930
variable "subnetwork" {

examples/mig/autoscaler/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
*/
1616

1717
provider "google" {
18-
credentials = file(var.credentials_path)
18+
1919
project = var.project_id
2020
region = var.region
2121
version = "~> 2.7.0"
2222
}
2323

2424
provider "google-beta" {
25-
credentials = file(var.credentials_path)
25+
2626
project = var.project_id
2727
region = var.region
2828
version = "~> 2.7.0"

examples/mig/autoscaler/variables.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Google LLC
2+
* Copyright 2019 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -14,16 +14,17 @@
1414
* limitations under the License.
1515
*/
1616

17-
variable "credentials_path" {
18-
description = "The path to the GCP credentials JSON file"
19-
}
17+
2018

2119
variable "project_id" {
2220
description = "The GCP project to use for integration tests"
21+
type = string
2322
}
2423

2524
variable "region" {
2625
description = "The GCP region to create and test resources in"
26+
type = string
27+
default = "us-central1"
2728
}
2829

2930
variable "subnetwork" {

examples/mig/full/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
*/
1616

1717
provider "google" {
18-
credentials = file(var.credentials_path)
18+
1919
project = var.project_id
2020
region = var.region
2121
version = "~> 2.7.0"
2222
}
2323

2424
provider "google-beta" {
25-
credentials = file(var.credentials_path)
25+
2626
project = var.project_id
2727
region = var.region
2828
version = "~> 2.7.0"

examples/mig/full/variables.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2018 Google LLC
2+
* Copyright 2019 Google LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,8 @@ variable "hostname" {
2525

2626
variable "region" {
2727
description = "The GCP region where instances will be deployed."
28+
type = string
29+
default = "us-central1"
2830
}
2931

3032
variable "network" {
@@ -39,12 +41,10 @@ variable "subnetwork" {
3941

4042
variable "project_id" {
4143
description = "The GCP project to use for integration tests"
44+
type = string
4245
}
4346

44-
variable "credentials_path" {
45-
description = "The path to the GCP credentials JSON file"
46-
default = ""
47-
}
47+
4848

4949
variable "subnetwork_project" {
5050
description = "The project that subnetwork belongs to"

0 commit comments

Comments
 (0)