mirror of
https://github.com/puppetmaster/typhoon.git
synced 2025-07-05 07:54:35 +02:00
Create controller instances across zones in the region
* Change controller instances to automatically span zones in a region * Remove the `zone` required variable
This commit is contained in:
@ -14,12 +14,18 @@ resource "google_dns_record_set" "etcds" {
|
||||
rrdatas = ["${element(google_compute_instance.controllers.*.network_interface.0.address, count.index)}"]
|
||||
}
|
||||
|
||||
# Zones in the region
|
||||
data "google_compute_zones" "available" {
|
||||
region = "${var.region}"
|
||||
status = "UP"
|
||||
}
|
||||
|
||||
# Controller instances
|
||||
resource "google_compute_instance" "controllers" {
|
||||
count = "${var.count}"
|
||||
|
||||
name = "${var.cluster_name}-controller-${count.index}"
|
||||
zone = "${var.zone}"
|
||||
zone = "${element(data.google_compute_zones.available.names, count.index)}"
|
||||
machine_type = "${var.machine_type}"
|
||||
|
||||
metadata {
|
||||
|
@ -30,9 +30,9 @@ variable "count" {
|
||||
description = "Number of controller compute instances the instance group should manage"
|
||||
}
|
||||
|
||||
variable "zone" {
|
||||
variable "region" {
|
||||
type = "string"
|
||||
description = "Google zone that compute instances in the group should be created in (e.g. gcloud compute zones list)"
|
||||
description = "Google Cloud region (e.g. us-central1, see `gcloud compute regions list`)."
|
||||
}
|
||||
|
||||
variable "machine_type" {
|
||||
|
Reference in New Issue
Block a user