Skip to content

Commit

Permalink
Merge pull request #89 from terraform-google-modules/internal/remove-…
Browse files Browse the repository at this point in the history
…credentials-path

Remove credentials_path and credentials_path_relative
  • Loading branch information
Jberlinsky authored Mar 27, 2019
2 parents 5dc6786 + fc43491 commit ff61512
Show file tree
Hide file tree
Showing 60 changed files with 28 additions and 199 deletions.
2 changes: 0 additions & 2 deletions examples/deploy_service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ It will:
|------|-------------|:----:|:-----:|:-----:|
| cluster\_name\_suffix | A suffix to append to the default cluster name | string | `""` | no |
| compute\_engine\_service\_account | Service account to associate to the nodes in the cluster | string | n/a | yes |
| credentials\_path | The path to the GCP credentials JSON file | string | n/a | yes |
| ip\_range\_pods | The secondary ip range to use for pods | string | n/a | yes |
| ip\_range\_services | The secondary ip range to use for pods | string | n/a | yes |
| network | The VPC network to host the cluster in | string | n/a | yes |
Expand All @@ -31,7 +30,6 @@ It will:
| ca\_certificate | |
| client\_token | |
| cluster\_name | Cluster name |
| credentials\_path | |
| ip\_range\_pods | The secondary IP range used for pods |
| ip\_range\_services | The secondary IP range used for services |
| kubernetes\_endpoint | |
Expand Down
10 changes: 4 additions & 6 deletions examples/deploy_service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ locals {
}

provider "google" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

provider "google-beta" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

provider "kubernetes" {
Expand Down
4 changes: 0 additions & 4 deletions examples/deploy_service/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ variable "project_id" {
description = "The project ID to host the cluster in"
}

variable "credentials_path" {
description = "The path to the GCP credentials JSON file"
}

variable "cluster_name_suffix" {
description = "A suffix to append to the default cluster name"
default = ""
Expand Down
2 changes: 0 additions & 2 deletions examples/node_pool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This example illustrates how to create a cluster with multiple custom node-pool
|------|-------------|:----:|:-----:|:-----:|
| cluster\_name\_suffix | A suffix to append to the default cluster name | string | `""` | no |
| compute\_engine\_service\_account | Service account to associate to the nodes in the cluster | string | n/a | yes |
| credentials\_path | The path to the GCP credentials JSON file | string | n/a | yes |
| ip\_range\_pods | The secondary ip range to use for pods | string | n/a | yes |
| ip\_range\_services | The secondary ip range to use for pods | string | n/a | yes |
| network | The VPC network to host the cluster in | string | n/a | yes |
Expand All @@ -26,7 +25,6 @@ This example illustrates how to create a cluster with multiple custom node-pool
| ca\_certificate | |
| client\_token | |
| cluster\_name | Cluster name |
| credentials\_path | |
| ip\_range\_pods | The secondary IP range used for pods |
| ip\_range\_services | The secondary IP range used for services |
| kubernetes\_endpoint | |
Expand Down
10 changes: 4 additions & 6 deletions examples/node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ locals {
}

provider "google" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

provider "google-beta" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

module "gke" {
Expand Down
4 changes: 0 additions & 4 deletions examples/node_pool/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ variable "project_id" {
description = "The project ID to host the cluster in"
}

variable "credentials_path" {
description = "The path to the GCP credentials JSON file"
}

variable "cluster_name_suffix" {
description = "A suffix to append to the default cluster name"
default = ""
Expand Down
2 changes: 0 additions & 2 deletions examples/shared_vpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This example illustrates how to create a simple cluster where the host network i
|------|-------------|:----:|:-----:|:-----:|
| cluster\_name\_suffix | A suffix to append to the default cluster name | string | `""` | no |
| compute\_engine\_service\_account | Service account to associate to the nodes in the cluster | string | n/a | yes |
| credentials\_path | The path to the GCP credentials JSON file | string | n/a | yes |
| ip\_range\_pods | The secondary ip range to use for pods | string | n/a | yes |
| ip\_range\_services | The secondary ip range to use for pods | string | n/a | yes |
| network | The VPC network to host the cluster in | string | n/a | yes |
Expand All @@ -26,7 +25,6 @@ This example illustrates how to create a simple cluster where the host network i
| ca\_certificate | |
| client\_token | |
| cluster\_name | Cluster name |
| credentials\_path | |
| ip\_range\_pods | The secondary IP range used for pods |
| ip\_range\_services | The secondary IP range used for services |
| kubernetes\_endpoint | |
Expand Down
10 changes: 4 additions & 6 deletions examples/shared_vpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ locals {
}

provider "google" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

provider "google-beta" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

module "gke" {
Expand Down
4 changes: 0 additions & 4 deletions examples/shared_vpc/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ variable "project_id" {
description = "The project ID to host the cluster in"
}

variable "credentials_path" {
description = "The path to the GCP credentials JSON file"
}

variable "cluster_name_suffix" {
description = "A suffix to append to the default cluster name"
default = ""
Expand Down
2 changes: 0 additions & 2 deletions examples/simple_regional/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This example illustrates how to create a simple cluster.
|------|-------------|:----:|:-----:|:-----:|
| cluster\_name\_suffix | A suffix to append to the default cluster name | string | `""` | no |
| compute\_engine\_service\_account | Service account to associate to the nodes in the cluster | string | n/a | yes |
| credentials\_path | The path to the GCP credentials JSON file | string | n/a | yes |
| ip\_range\_pods | The secondary ip range to use for pods | string | n/a | yes |
| ip\_range\_services | The secondary ip range to use for pods | string | n/a | yes |
| network | The VPC network to host the cluster in | string | n/a | yes |
Expand All @@ -25,7 +24,6 @@ This example illustrates how to create a simple cluster.
| ca\_certificate | |
| client\_token | |
| cluster\_name | Cluster name |
| credentials\_path | |
| ip\_range\_pods | The secondary IP range used for pods |
| ip\_range\_services | The secondary IP range used for services |
| kubernetes\_endpoint | |
Expand Down
10 changes: 4 additions & 6 deletions examples/simple_regional/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ locals {
}

provider "google" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

provider "google-beta" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

module "gke" {
Expand Down
4 changes: 0 additions & 4 deletions examples/simple_regional/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ variable "project_id" {
description = "The project ID to host the cluster in"
}

variable "credentials_path" {
description = "The path to the GCP credentials JSON file"
}

variable "cluster_name_suffix" {
description = "A suffix to append to the default cluster name"
default = ""
Expand Down
2 changes: 0 additions & 2 deletions examples/simple_regional_private/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This example illustrates how to create a simple private cluster.
|------|-------------|:----:|:-----:|:-----:|
| cluster\_name\_suffix | A suffix to append to the default cluster name | string | `""` | no |
| compute\_engine\_service\_account | Service account to associate to the nodes in the cluster | string | n/a | yes |
| credentials\_path | The path to the GCP credentials JSON file | string | n/a | yes |
| ip\_range\_pods | The secondary ip range to use for pods | string | n/a | yes |
| ip\_range\_services | The secondary ip range to use for pods | string | n/a | yes |
| network | The VPC network to host the cluster in | string | n/a | yes |
Expand All @@ -25,7 +24,6 @@ This example illustrates how to create a simple private cluster.
| ca\_certificate | |
| client\_token | |
| cluster\_name | Cluster name |
| credentials\_path | |
| ip\_range\_pods | The secondary IP range used for pods |
| ip\_range\_services | The secondary IP range used for services |
| kubernetes\_endpoint | |
Expand Down
5 changes: 2 additions & 3 deletions examples/simple_regional_private/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ locals {
}

provider "google-beta" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

data "google_compute_subnetwork" "subnetwork" {
Expand Down
4 changes: 0 additions & 4 deletions examples/simple_regional_private/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ variable "project_id" {
description = "The project ID to host the cluster in"
}

variable "credentials_path" {
description = "The path to the GCP credentials JSON file"
}

variable "cluster_name_suffix" {
description = "A suffix to append to the default cluster name"
default = ""
Expand Down
2 changes: 0 additions & 2 deletions examples/simple_zonal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ This example illustrates how to create a simple cluster.
| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| cluster\_name\_suffix | A suffix to append to the default cluster name | string | `""` | no |
| credentials\_path | The path to the GCP credentials JSON file | string | n/a | yes |
| ip\_range\_pods | The secondary ip range to use for pods | string | n/a | yes |
| ip\_range\_services | The secondary ip range to use for pods | string | n/a | yes |
| network | The VPC network to host the cluster in | string | n/a | yes |
Expand All @@ -25,7 +24,6 @@ This example illustrates how to create a simple cluster.
| ca\_certificate | |
| client\_token | |
| cluster\_name | Cluster name |
| credentials\_path | |
| ip\_range\_pods | The secondary IP range used for pods |
| ip\_range\_services | The secondary IP range used for services |
| kubernetes\_endpoint | |
Expand Down
10 changes: 4 additions & 6 deletions examples/simple_zonal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ locals {
}

provider "google" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

provider "google-beta" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

module "gke" {
Expand Down
4 changes: 0 additions & 4 deletions examples/simple_zonal/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ variable "project_id" {
description = "The project ID to host the cluster in"
}

variable "credentials_path" {
description = "The path to the GCP credentials JSON file"
}

variable "cluster_name_suffix" {
description = "A suffix to append to the default cluster name"
default = ""
Expand Down
2 changes: 0 additions & 2 deletions examples/simple_zonal_private/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This example illustrates how to create a simple private cluster.
|------|-------------|:----:|:-----:|:-----:|
| cluster\_name\_suffix | A suffix to append to the default cluster name | string | `""` | no |
| compute\_engine\_service\_account | Service account to associate to the nodes in the cluster | string | n/a | yes |
| credentials\_path | The path to the GCP credentials JSON file | string | n/a | yes |
| ip\_range\_pods | The secondary ip range to use for pods | string | n/a | yes |
| ip\_range\_services | The secondary ip range to use for pods | string | n/a | yes |
| network | The VPC network to host the cluster in | string | n/a | yes |
Expand All @@ -26,7 +25,6 @@ This example illustrates how to create a simple private cluster.
| ca\_certificate | |
| client\_token | |
| cluster\_name | Cluster name |
| credentials\_path | |
| ip\_range\_pods | The secondary IP range used for pods |
| ip\_range\_services | The secondary IP range used for services |
| kubernetes\_endpoint | |
Expand Down
5 changes: 2 additions & 3 deletions examples/simple_zonal_private/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ locals {
}

provider "google-beta" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

data "google_compute_subnetwork" "subnetwork" {
Expand Down
4 changes: 0 additions & 4 deletions examples/simple_zonal_private/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ variable "project_id" {
description = "The project ID to host the cluster in"
}

variable "credentials_path" {
description = "The path to the GCP credentials JSON file"
}

variable "cluster_name_suffix" {
description = "A suffix to append to the default cluster name"
default = ""
Expand Down
2 changes: 0 additions & 2 deletions examples/stub_domains/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ It will:
|------|-------------|:----:|:-----:|:-----:|
| cluster\_name\_suffix | A suffix to append to the default cluster name | string | `""` | no |
| compute\_engine\_service\_account | Service account to associate to the nodes in the cluster | string | n/a | yes |
| credentials\_path | The path to the GCP credentials JSON file | string | n/a | yes |
| ip\_range\_pods | The secondary ip range to use for pods | string | n/a | yes |
| ip\_range\_services | The secondary ip range to use for pods | string | n/a | yes |
| network | The VPC network to host the cluster in | string | n/a | yes |
Expand All @@ -30,7 +29,6 @@ It will:
| ca\_certificate | |
| client\_token | |
| cluster\_name | Cluster name |
| credentials\_path | |
| ip\_range\_pods | The secondary IP range used for pods |
| ip\_range\_services | The secondary IP range used for services |
| kubernetes\_endpoint | |
Expand Down
10 changes: 4 additions & 6 deletions examples/stub_domains/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ locals {
}

provider "google" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

provider "google-beta" {
version = "~> 2.2"
credentials = "${file(var.credentials_path)}"
region = "${var.region}"
version = "~> 2.2"
region = "${var.region}"
}

module "gke" {
Expand Down
4 changes: 0 additions & 4 deletions examples/stub_domains/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ variable "project_id" {
description = "The project ID to host the cluster in"
}

variable "credentials_path" {
description = "The path to the GCP credentials JSON file"
}

variable "cluster_name_suffix" {
description = "A suffix to append to the default cluster name"
default = ""
Expand Down
4 changes: 0 additions & 4 deletions test/fixtures/all_examples/test_outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ output "project_id" {
value = "${var.project_id}"
}

output "credentials_path" {
value = "${var.credentials_path}"
}

output "region" {
value = "${module.gke.region}"
}
Expand Down
1 change: 0 additions & 1 deletion test/fixtures/deploy_service/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module "example" {
source = "../../../examples/deploy_service"

project_id = "${var.project_id}"
credentials_path = "${local.credentials_path}"
cluster_name_suffix = "-${random_string.suffix.result}"
region = "${var.region}"
network = "${google_compute_network.main.name}"
Expand Down
5 changes: 0 additions & 5 deletions test/fixtures/deploy_service/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,13 @@
* limitations under the License.
*/

locals {
credentials_path = "${path.module}/${var.credentials_path_relative}"
}

resource "random_string" "suffix" {
length = 4
special = false
upper = false
}

provider "google" {
credentials = "${file(local.credentials_path)}"
project = "${var.project_id}"
}

Expand Down
Loading

0 comments on commit ff61512

Please sign in to comment.