Skip to content
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

Autoscaling with min 0 read replicas not possible #236

Closed
thomasfinstad opened this issue Aug 31, 2021 · 1 comment · Fixed by #243
Closed

Autoscaling with min 0 read replicas not possible #236

thomasfinstad opened this issue Aug 31, 2021 · 1 comment · Fixed by #243

Comments

@thomasfinstad
Copy link

Description

Due to the instance count being taken directly from var.replica_scale_min the writer node also gets deleted when minimum read replicas is set to zero

Versions

  • Terraform: 0.14.7
  • Provider(s):
    • provider registry.terraform.io/datadog/datadog v2.26.1
    • provider registry.terraform.io/hashicorp/archive v2.2.0
    • provider registry.terraform.io/hashicorp/aws v3.56.0
    • provider registry.terraform.io/hashicorp/external v2.1.0
    • provider registry.terraform.io/hashicorp/local v2.1.0
    • provider registry.terraform.io/hashicorp/null v3.1.0
    • provider registry.terraform.io/hashicorp/random v3.1.0
  • Module: 5.2.0

Reproduction

Steps to reproduce the behavior:
setup a cluster with var.replica_scale_enabled turned on, with var.replica_scale_min set to one you will always have a replica even when not needed (a scale event might need to be triggered once for the autoscale policy to take effect). Setting var.replica_scale_min to zero will remove the writer node as well as the read replica

Code Snippet to Reproduce

Expected behavior

When var.create_cluster is set to true the instance count should use the var.replica_scale_min as it does now, unless that is zero/less than 1, at which point the value should be set to 1 as a fallback

Actual behavior

Directly drawing from var.replica_scale_min, forcing a minimum of 1 read replica, which means 2 nodes is the minimum if auto scaling is desired

Additional context

This would be a nice money saving feature for the module.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant