github.com/m3db/m3@v1.5.0/kube/terraform/examples/gcp/main.tf (about) 1 provider "google" { 2 project = "${var.gcp_project_id}" 3 region = "${var.gcp_region}" 4 } 5 6 resource "google_container_cluster" "primary" { 7 name = "m3db-bundle-cluster" 8 location = "${var.gcp_region}" 9 initial_node_count = 3 10 11 12 # Setting an empty username and password explicitly disables basic auth 13 master_auth { 14 username = "" 15 password = "" 16 } 17 18 node_config { 19 preemptible = false 20 machine_type = "${var.gcp_instance_type}" 21 22 oauth_scopes = [ 23 "https://www.googleapis.com/auth/logging.write", 24 "https://www.googleapis.com/auth/monitoring", 25 ] 26 27 metadata { 28 disable-legacy-endpoints = "true" 29 } 30 } 31 32 timeouts { 33 create = "30m" 34 update = "40m" 35 } 36 } 37 38 provider "kubernetes" { 39 host = "${google_container_cluster.primary.endpoint}" 40 41 client_certificate = "${base64decode(google_container_cluster.primary.master_auth.0.client_certificate)}" 42 client_key = "${base64decode(google_container_cluster.primary.master_auth.0.client_key)}" 43 cluster_ca_certificate = "${base64decode(google_container_cluster.primary.master_auth.0.cluster_ca_certificate)}" 44 }