terraform-aws-rds-aurora
terraform-aws-rds-aurora copied to clipboard
Autoscaling does not scale cluster to min capacity on creation
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.
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.
this appears to be related to an upstream issue https://github.com/hashicorp/terraform-provider-aws/issues/31329
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
@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.
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
This issue was automatically closed because of stale in 10 days
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.