mirror of
https://github.com/google/nomulus.git
synced 2025-05-03 05:27:52 +02:00
With terraform (https://terraform.io) we can convert most of the infrastructure setup into code. This simplifies setting up a new proxy as well as providing reproducibility in the setup, eliminating human errors as much as possible. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=190634711
37 lines
1 KiB
HCL
37 lines
1 KiB
HCL
locals {
|
|
proxy_cluster_zone = "${lookup(var.proxy_cluster_zones, var.proxy_cluster_region)}"
|
|
}
|
|
|
|
data "google_container_engine_versions" "gke_version" {
|
|
zone = "${local.proxy_cluster_zone}"
|
|
}
|
|
|
|
resource "google_container_cluster" "proxy_cluster" {
|
|
name = "proxy-cluster-${var.proxy_cluster_region}"
|
|
zone = "${local.proxy_cluster_zone}"
|
|
node_version = "${data.google_container_engine_versions.gke_version.latest_node_version}"
|
|
min_master_version = "${data.google_container_engine_versions.gke_version.latest_master_version}"
|
|
|
|
node_pool {
|
|
name = "proxy-node-pool"
|
|
initial_node_count = 1
|
|
node_config {
|
|
tags = [
|
|
"proxy-cluster"]
|
|
service_account = "${var.proxy_service_account_email}"
|
|
oauth_scopes = [
|
|
"https://www.googleapis.com/auth/cloud-platform",
|
|
"https://www.googleapis.com/auth/userinfo.email"
|
|
]
|
|
}
|
|
autoscaling {
|
|
max_node_count = 5
|
|
min_node_count = 1
|
|
}
|
|
management {
|
|
auto_repair = true
|
|
auto_upgrade = true
|
|
}
|
|
}
|
|
}
|
|
|