Skip to content

Commit

Permalink
Run terraform fmt as part of linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jberlinsky committed Dec 13, 2018
1 parent 7953722 commit 2bbf53a
Show file tree
Hide file tree
Showing 27 changed files with 158 additions and 154 deletions.
2 changes: 1 addition & 1 deletion cluster_regional.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ resource "null_resource" "wait_for_regional_cluster" {
}

provisioner "local-exec" {
when = "destroy"
when = "destroy"
command = "${path.module}/scripts/wait-for-cluster.sh ${var.project_id} ${var.name}"
}

Expand Down
2 changes: 1 addition & 1 deletion cluster_zonal.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ resource "null_resource" "wait_for_zonal_cluster" {
}

provisioner "local-exec" {
when = "destroy"
when = "destroy"
command = "${path.module}/scripts/wait-for-cluster.sh ${var.project_id} ${var.name}"
}

Expand Down
16 changes: 8 additions & 8 deletions examples/deploy_service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ provider "kubernetes" {
data "google_client_config" "default" {}

module "gke" {
source = "../../"
project_id = "${var.project_id}"
name = "${local.cluster_type}-cluster"
region = "${var.region}"
network = "${var.network}"
subnetwork = "${var.subnetwork}"
ip_range_pods = "${var.ip_range_pods}"
ip_range_services = "${var.ip_range_services}"
source = "../../"
project_id = "${var.project_id}"
name = "${local.cluster_type}-cluster"
region = "${var.region}"
network = "${var.network}"
subnetwork = "${var.subnetwork}"
ip_range_pods = "${var.ip_range_pods}"
ip_range_services = "${var.ip_range_services}"
kubernetes_version = "1.11.5-gke.4"
service_account = "${var.compute_engine_service_account}"
}
Expand Down
2 changes: 1 addition & 1 deletion examples/deploy_service/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ output "client_token" {
}

output "ca_certificate" {
value = "${module.gke.ca_certificate}"
value = "${module.gke.ca_certificate}"
}
22 changes: 11 additions & 11 deletions examples/node_pool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ provider "google" {
}

module "gke" {
source = "../../"
project_id = "${var.project_id}"
name = "${local.cluster_type}-cluster"
region = "${var.region}"
network = "${var.network}"
subnetwork = "${var.subnetwork}"
ip_range_pods = "${var.ip_range_pods}"
ip_range_services = "${var.ip_range_services}"
source = "../../"
project_id = "${var.project_id}"
name = "${local.cluster_type}-cluster"
region = "${var.region}"
network = "${var.network}"
subnetwork = "${var.subnetwork}"
ip_range_pods = "${var.ip_range_pods}"
ip_range_services = "${var.ip_range_services}"
kubernetes_version = "1.11.5-gke.4"
node_version = "1.11.5-gke.4"
node_version = "1.11.5-gke.4"

node_pools = [
{
name = "pool-01"
min_count = 4
name = "pool-01"
min_count = 4
service_account = "${var.compute_engine_service_account}"
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/node_pool/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ output "client_token" {
}

output "ca_certificate" {
value = "${module.gke.ca_certificate}"
value = "${module.gke.ca_certificate}"
}
20 changes: 10 additions & 10 deletions examples/simple_regional/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ provider "google" {
}

module "gke" {
source = "../../"
project_id = "${var.project_id}"
name = "${local.cluster_type}-cluster"
regional = true
region = "${var.region}"
network = "${var.network}"
subnetwork = "${var.subnetwork}"
ip_range_pods = "${var.ip_range_pods}"
ip_range_services = "${var.ip_range_services}"
source = "../../"
project_id = "${var.project_id}"
name = "${local.cluster_type}-cluster"
regional = true
region = "${var.region}"
network = "${var.network}"
subnetwork = "${var.subnetwork}"
ip_range_pods = "${var.ip_range_pods}"
ip_range_services = "${var.ip_range_services}"
kubernetes_version = "1.11.5-gke.4"
node_version = "1.11.5-gke.4"
node_version = "1.11.5-gke.4"
service_account = "${var.compute_engine_service_account}"
}

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_regional/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ output "client_token" {
}

output "ca_certificate" {
value = "${module.gke.ca_certificate}"
value = "${module.gke.ca_certificate}"
}
22 changes: 11 additions & 11 deletions examples/simple_zonal/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,18 @@ provider "google" {
}

module "gke" {
source = "../../"
project_id = "${var.project_id}"
name = "${local.cluster_type}-cluster"
regional = false
region = "${var.region}"
zones = "${var.zones}"
network = "${var.network}"
subnetwork = "${var.subnetwork}"
ip_range_pods = "${var.ip_range_pods}"
ip_range_services = "${var.ip_range_services}"
source = "../../"
project_id = "${var.project_id}"
name = "${local.cluster_type}-cluster"
regional = false
region = "${var.region}"
zones = "${var.zones}"
network = "${var.network}"
subnetwork = "${var.subnetwork}"
ip_range_pods = "${var.ip_range_pods}"
ip_range_services = "${var.ip_range_services}"
kubernetes_version = "1.11.4-gke.8"
node_version = "1.11.4-gke.8"
node_version = "1.11.4-gke.8"
service_account = "${var.compute_engine_service_account}"
}

Expand Down
2 changes: 1 addition & 1 deletion examples/simple_zonal/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ output "client_token" {
}

output "ca_certificate" {
value = "${module.gke.ca_certificate}"
value = "${module.gke.ca_certificate}"
}
20 changes: 10 additions & 10 deletions examples/stub_domains/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ provider "google" {
}

module "gke" {
source = "../../"
project_id = "${var.project_id}"
name = "${local.cluster_type}-cluster"
region = "${var.region}"
network = "${var.network}"
subnetwork = "${var.subnetwork}"
ip_range_pods = "${var.ip_range_pods}"
ip_range_services = "${var.ip_range_services}"
network_policy = true
source = "../../"
project_id = "${var.project_id}"
name = "${local.cluster_type}-cluster"
region = "${var.region}"
network = "${var.network}"
subnetwork = "${var.subnetwork}"
ip_range_pods = "${var.ip_range_pods}"
ip_range_services = "${var.ip_range_services}"
network_policy = true
kubernetes_version = "1.11.5-gke.4"
node_version = "1.11.5-gke.4"
node_version = "1.11.5-gke.4"
service_account = "${var.compute_engine_service_account}"

stub_domains {
Expand Down
2 changes: 1 addition & 1 deletion examples/stub_domains/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ output "client_token" {
}

output "ca_certificate" {
value = "${module.gke.ca_certificate}"
value = "${module.gke.ca_certificate}"
}
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ data "google_compute_zones" "available" {
}

resource "random_shuffle" "available_zones" {
input = ["${data.google_compute_zones.available.names}"]
input = ["${data.google_compute_zones.available.names}"]
result_count = 3
}

Expand Down
14 changes: 7 additions & 7 deletions test/fixtures/deploy_service/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
module "example" {
source = "../../../examples/deploy_service"

project_id = "${var.project_id}"
credentials_path = "${local.credentials_path}"
region = "${var.region}"
network = "${google_compute_network.main.name}"
subnetwork = "${google_compute_subnetwork.main.name}"
ip_range_pods = "${google_compute_subnetwork.main.secondary_ip_range.0.range_name}"
ip_range_services = "${google_compute_subnetwork.main.secondary_ip_range.1.range_name}"
project_id = "${var.project_id}"
credentials_path = "${local.credentials_path}"
region = "${var.region}"
network = "${google_compute_network.main.name}"
subnetwork = "${google_compute_subnetwork.main.name}"
ip_range_pods = "${google_compute_subnetwork.main.secondary_ip_range.0.range_name}"
ip_range_services = "${google_compute_subnetwork.main.secondary_ip_range.1.range_name}"
compute_engine_service_account = "${var.compute_engine_service_account}"
}
20 changes: 11 additions & 9 deletions test/fixtures/deploy_service/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,34 @@ locals {
}

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

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

resource "google_compute_network" "main" {
name = "cft-gke-test-${random_string.suffix.result}"
name = "cft-gke-test-${random_string.suffix.result}"
auto_create_subnetworks = "false"
}

resource "google_compute_subnetwork" "main" {
name = "cft-gke-test-${random_string.suffix.result}"
name = "cft-gke-test-${random_string.suffix.result}"
ip_cidr_range = "10.0.0.0/17"
region = "${var.region}"
network = "${google_compute_network.main.self_link}"
region = "${var.region}"
network = "${google_compute_network.main.self_link}"

secondary_ip_range {
range_name = "cft-gke-test-pods-${random_string.suffix.result}"
range_name = "cft-gke-test-pods-${random_string.suffix.result}"
ip_cidr_range = "192.168.0.0/18"
}

secondary_ip_range {
range_name = "cft-gke-test-services-${random_string.suffix.result}"
range_name = "cft-gke-test-services-${random_string.suffix.result}"
ip_cidr_range = "192.168.64.0/18"
}
}
14 changes: 7 additions & 7 deletions test/fixtures/node_pool/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
module "example" {
source = "../../../examples/node_pool"

project_id = "${var.project_id}"
credentials_path = "${local.credentials_path}"
region = "${var.region}"
network = "${google_compute_network.main.name}"
subnetwork = "${google_compute_subnetwork.main.name}"
ip_range_pods = "${google_compute_subnetwork.main.secondary_ip_range.0.range_name}"
ip_range_services = "${google_compute_subnetwork.main.secondary_ip_range.1.range_name}"
project_id = "${var.project_id}"
credentials_path = "${local.credentials_path}"
region = "${var.region}"
network = "${google_compute_network.main.name}"
subnetwork = "${google_compute_subnetwork.main.name}"
ip_range_pods = "${google_compute_subnetwork.main.secondary_ip_range.0.range_name}"
ip_range_services = "${google_compute_subnetwork.main.secondary_ip_range.1.range_name}"
compute_engine_service_account = "${var.compute_engine_service_account}"
}
20 changes: 11 additions & 9 deletions test/fixtures/node_pool/network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,34 @@ locals {
}

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

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

resource "google_compute_network" "main" {
name = "cft-gke-test-${random_string.suffix.result}"
name = "cft-gke-test-${random_string.suffix.result}"
auto_create_subnetworks = "false"
}

resource "google_compute_subnetwork" "main" {
name = "cft-gke-test-${random_string.suffix.result}"
name = "cft-gke-test-${random_string.suffix.result}"
ip_cidr_range = "10.0.0.0/17"
region = "${var.region}"
network = "${google_compute_network.main.self_link}"
region = "${var.region}"
network = "${google_compute_network.main.self_link}"

secondary_ip_range {
range_name = "cft-gke-test-pods-${random_string.suffix.result}"
range_name = "cft-gke-test-pods-${random_string.suffix.result}"
ip_cidr_range = "192.168.0.0/18"
}

secondary_ip_range {
range_name = "cft-gke-test-services-${random_string.suffix.result}"
range_name = "cft-gke-test-services-${random_string.suffix.result}"
ip_cidr_range = "192.168.64.0/18"
}
}
2 changes: 1 addition & 1 deletion test/fixtures/shared/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ output "client_token" {

output "ca_certificate" {
description = "The cluster CA certificate"
value = "${module.example.ca_certificate}"
value = "${module.example.ca_certificate}"
}
18 changes: 5 additions & 13 deletions test/fixtures/shared/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,15 @@
* limitations under the License.
*/

variable "project_id" {
variable "project_id" {}

}

variable "credentials_path_relative" {

}
variable "credentials_path_relative" {}

variable "region" {

}
variable "region" {}

variable "zones" {
type = "list"
type = "list"
default = []
}

variable "compute_engine_service_account" {

}
variable "compute_engine_service_account" {}
14 changes: 7 additions & 7 deletions test/fixtures/simple_regional/example.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
module "example" {
source = "../../../examples/simple_regional"

project_id = "${var.project_id}"
credentials_path = "${local.credentials_path}"
region = "${var.region}"
network = "${google_compute_network.main.name}"
subnetwork = "${google_compute_subnetwork.main.name}"
ip_range_pods = "${google_compute_subnetwork.main.secondary_ip_range.0.range_name}"
ip_range_services = "${google_compute_subnetwork.main.secondary_ip_range.1.range_name}"
project_id = "${var.project_id}"
credentials_path = "${local.credentials_path}"
region = "${var.region}"
network = "${google_compute_network.main.name}"
subnetwork = "${google_compute_subnetwork.main.name}"
ip_range_pods = "${google_compute_subnetwork.main.secondary_ip_range.0.range_name}"
ip_range_services = "${google_compute_subnetwork.main.secondary_ip_range.1.range_name}"
compute_engine_service_account = "${var.compute_engine_service_account}"
}
Loading

0 comments on commit 2bbf53a

Please sign in to comment.