terraform-aws-rds-aurora icon indicating copy to clipboard operation
terraform-aws-rds-aurora copied to clipboard

Cannot create serverless v1 postgres

Open steve-fundapps opened this issue 3 years ago β€’ 1 comments

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 tested 7.2.0 and 6.2.0)

  • Terraform version: Terraform v1.2.2

  • Provider version(s): provider registry.terraform.io/camptocamp/jwt v1.0.0 provider registry.terraform.io/datadog/datadog v3.13.1 provider registry.terraform.io/hashicorp/aws v4.22.0 provider registry.terraform.io/hashicorp/random v3.3.2 provider 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

steve-fundapps avatar Jul 20 '22 08:07 steve-fundapps

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.

promenadeviki avatar Aug 03 '22 14:08 promenadeviki

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).

AllanBenson001 avatar Aug 15 '22 09:08 AllanBenson001

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 avatar Aug 16 '22 07:08 AllanBenson001

@AllanBenson001 This still doesn't solve the issue for the same error happening with non serverless mysql instances, unfortunately.

promenadeviki avatar Aug 17 '22 16:08 promenadeviki

This issue has been resolved in version 7.4.0 :tada:

antonbabenko avatar Sep 07 '22 11:09 antonbabenko

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[bot] avatar Apr 13 '23 02:04 github-actions[bot]