terraform-aws-rds-aurora
terraform-aws-rds-aurora copied to clipboard
Cannot create serverless v1 postgres
Description
When running Terraform using the module, the module.this.module.aurora_postgresql.aws_rds_cluster.this[0] fails with a Error: error creating RDS cluster: InvalidParameterCombination: Cannot find version null for aurora-postgresql β status code: 400, request id: b3b37767-af5a-4684-8b81-60ec5a244b05 error
I suspect this may be a change to the AWS API
Versions
-
Module version:
7.2.2(also tested7.2.0and6.2.0) -
Terraform version:
Terraform v1.2.2 -
Provider version(s):
provider registry.terraform.io/camptocamp/jwt v1.0.0provider registry.terraform.io/datadog/datadog v3.13.1provider registry.terraform.io/hashicorp/aws v4.22.0provider registry.terraform.io/hashicorp/random v3.3.2provider registry.terraform.io/pagerduty/pagerduty v2.5.2
Reproduction Code
module "aurora_postgresql" {
source = "terraform-aws-modules/rds-aurora/aws"
version = "7.2.2"
name = "${var.service}-prod"
database_name = var.service
engine = "aurora-postgresql"
engine_mode = "serverless"
storage_encrypted = true
vpc_id = local.network.vpc_id
subnets = local.network.subnet_ids
create_security_group = true
allowed_cidr_blocks = local.network.private_cidr_blocks
monitoring_interval = 60
apply_immediately = true
skip_final_snapshot = true
scaling_configuration = {
auto_pause = true
min_capacity = 2
max_capacity = 16
seconds_until_auto_pause = 300
timeout_action = "RollbackCapacityChange"
}
}
Steps to reproduce the behavior:
Using Scalr to deploy this to workspaces
Expected behavior
Resource should create
Actual behavior
Creation fails with Error: error creating RDS cluster: InvalidParameterCombination: Cannot find version null for aurora-postgresql β status code: 400, request id: b3b37767-af5a-4684-8b81-60ec5a244b05 message
Additional context
Issue is on line 61 of the main.tf in the module, where if var.engine_mode == "serverless" is passed to the local it will set the engine version to null and that seems to be now failing with the API.
engine_version = local.is_serverless ? null : var.engine_version
This seems to be related to this closed issue in which you have to specify the major/minor version. I had this issue with Aurora sql as well.
Specifying major/minor (as mentioned in this closed issue) makes no difference because whatever you pass in the engine_version variable is ignored for serverless databases (see additional context above).
Reproduction code needs to include:
engine_version = "10.18"
Line 61 on main.tf needs to be changed to:
engine_version = var.engine_version
@AllanBenson001 This still doesn't solve the issue for the same error happening with non serverless mysql instances, unfortunately.
This issue has been resolved in version 7.4.0 :tada:
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.