Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/cloudsql-instance/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ resource "google_sql_database_instance" "replicas" {
master_instance_name = google_sql_database_instance.primary.name

settings {
tier = var.tier
tier = coalesce(each.value.tier, var.tier)
edition = var.edition
deletion_protection_enabled = var.gcp_deletion_protection
disk_autoresize = var.disk_size == null
Expand Down
4 changes: 3 additions & 1 deletion modules/cloudsql-instance/variables.tf
Comment thread
Calvin-Cheng1 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,11 @@ variable "region" {
}

variable "replicas" {
description = "Map of NAME=> {REGION, KMS_KEY} for additional read replicas. Set to null to disable replica creation."
description = "Map of NAME=> {REGION, KMS_KEY, TIER} for additional read replicas. Tier defaults to the primary instance tier when unset. Set to null to disable replica creation."
type = map(object({
region = string
encryption_key_name = optional(string)
tier = optional(string)
}))
default = {}
nullable = false
Expand Down Expand Up @@ -287,6 +288,7 @@ variable "terraform_deletion_protection" {
variable "tier" {
description = "The machine type to use for the instances."
type = string
nullable = false
}

variable "time_zone" {
Expand Down