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 does not scale cluster to min capacity on creation #432

Closed
Neifn opened this issue Feb 17, 2024 · 6 comments
Closed

Autoscaling does not scale cluster to min capacity on creation #432

Neifn opened this issue Feb 17, 2024 · 6 comments

Comments

@Neifn
Copy link

Neifn commented Feb 17, 2024

Description

When creating a cluster with autoscaling enabled, cluster is not automatically scaled to autoscaling_min_capacity value and remains stuck with directly created instances.

  • [✅] ✋ I have searched the open/closed issues and my issue is not listed.

Versions

  • Module version [Required]: 9.0.0

  • Terraform version:
    1.7.2

  • Provider version(s):
    5.35.0

Reproduction Code [Required]

module "aurora" {
  source  = "terraform-aws-modules/rds-aurora/aws"
  version = "9.0.0"

  name  = "test-aurora"

  engine         = "aurora-mysql"
  engine_version = "5.7.mysql_aurora.2.11.4"
  instance_class = "db.t3.medium"

  port    = 3306
  vpc_id  = module.vpc.vpc_id
  subnets = module.vpc-subnets.subnet_ids

  master_username                     = "admin"
  manage_master_user_password         = true
  iam_database_authentication_enabled = true

  instances                = { primary = {} }
  autoscaling_enabled      = true
  autoscaling_min_capacity = 2
  autoscaling_max_capacity = 3


  allow_major_version_upgrade = true
  apply_immediately           = true
  copy_tags_to_snapshot       = true
  skip_final_snapshot         = true
}

Steps to reproduce the behavior:
terraform apply

Expected behavior

Reader nodes are scaled to the minimum capacity when cluster becomes available.

Actual behavior

Cluster will be created with only one instance. Autoscaling configuration will not add any reader nodes.

Additional context

If you set autoscaling_enabled to false and create aws_appautoscaling_target and aws_appautoscaling_policy outside the module with depends_on set to whole module reader nodes are created as expected.

@NeoMopp
Copy link

NeoMopp commented Mar 12, 2024

We have encountered the same issue recently, and found that the auto scaling policy is created, but seems to be inactive. By modifying the autoscaling policy, simply editing and saving, the auto scaler kicks in and creates the desired minimum instances.

@bryantbiggs
Copy link
Member

this appears to be related to an upstream issue hashicorp/terraform-provider-aws#31329

Copy link

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

@github-actions github-actions bot added the stale label Apr 12, 2024
@Neifn
Copy link
Author

Neifn commented Apr 12, 2024

@bryantbiggs I don't think it's directly related to the provider issue, given that it can be fixed by setting explicit dependency on whole module, as I described above.

@github-actions github-actions bot removed the stale label Apr 13, 2024
Copy link

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

@github-actions github-actions bot added the stale label May 13, 2024
Copy link

This issue was automatically closed because of stale in 10 days

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants