-
-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong replica initialization #190
Comments
The root of the problem is how the |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Hopefully I will be able to describe the problem correctly.
With a configuration like this
engine = "aurora-mysql" replica_scale_enabled = true replica_scale_max = 2 replica_scale_min = 1
I would expect to get 1 writer instance + 1 reader instance. Instead I only get 1 writer.
If I increase replica_scale_min to 2
replica_scale_min = 1
, I get 1 writer + 2 readers.With the current module, It is not possible to initialize the cluster with 1 writer and 1 reader.
I believe the solution leave here
resource "aws_rds_cluster_instance" "this" { count = var.create_cluster ? (var.replica_scale_enabled ? var.replica_scale_min : var.replica_count) : 0
instead it should be
resource "aws_rds_cluster_instance" "this" { count = var.create_cluster ? (var.replica_scale_enabled ? var.replica_scale_min + 1: var.replica_count) : 0
note, this important to have the cluster initialized with at least 1 reader otherwise the application autoscaler won't work, since it needs at least 1 reader to be present.
The text was updated successfully, but these errors were encountered: