Skip to content

Commit

Permalink
feat: allow setting replica DB engine version
Browse files Browse the repository at this point in the history
This is useful when upgrading mysql DB engines as the replica has
to be updated before the primary.
  • Loading branch information
deeno35 committed Apr 2, 2024
1 parent bc4d7c6 commit c801fb2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/bigeye/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2146,6 +2146,7 @@ module "datawatch_rds" {

# Replica
create_replica = var.datawatch_rds_replica_enabled
replica_engine_version = var.datawatch_rds_replica_engine_version
replica_instance_class = var.datawatch_rds_replica_instance_type
replica_backup_retention_period = var.datawatch_rds_replica_backup_retention_period

Expand Down
6 changes: 6 additions & 0 deletions modules/bigeye/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,12 @@ variable "datawatch_rds_replica_enabled" {
default = false
}

variable "datawatch_rds_replica_engine_version" {
description = "Defaults to engine_version. This is primarily used for engine upgrades as the replica has to be upgraded first."
type = string
default = ""
}

variable "datawatch_rds_replica_instance_type" {
description = "The instance type to use for datawatch read replica"
type = string
Expand Down
2 changes: 1 addition & 1 deletion modules/rds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ module "replica" {
apply_immediately = var.apply_immediately
identifier = "${var.name}-ro"
engine = "mysql"
engine_version = var.engine_version
engine_version = var.replica_engine_version != "" ? var.replica_engine_version : var.engine_version
auto_minor_version_upgrade = false
instance_class = var.replica_instance_class
deletion_protection = var.deletion_protection
Expand Down
7 changes: 7 additions & 0 deletions modules/rds/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ variable "create_replica" {
default = false
}

variable "replica_engine_version" {
description = "Defaults to engine_version. This is primarily used for engine upgrades as the replica has to be upgraded first."
type = string
default = ""
}


variable "replica_instance_class" {
description = "Instance class of the replica"
type = string
Expand Down

0 comments on commit c801fb2

Please sign in to comment.