hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.74k stars 9.09k forks source link

[Bug]: RDS DB upgrade from 14.9 to 16.3 and aws_db_parameter_group breaks #38984

Open Selva-Shan opened 3 weeks ago

Selva-Shan commented 3 weeks ago

Terraform Core Version

1.5.7

AWS Provider Version

5.47.0

Affected Resource(s)

Expected Behavior

RDS version upgrade from 14.9 to 16.3. RDS version should be upgraded successfully.

Actual Behavior

For some reason db parameter group name Cluster instance and Cluster are different, Which should not be the case as we are not modifying the db parameter group here.

Upon checking the status of the cluster instance parameter group it says "pending-reboot".

Cluster parameter group name shows default group name "default:aurora-postgresql-16" Cluster instance parameter group name shows custom one "postgres"

Below is the error message while applying the plan,

│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for
│ module.use_cases.module.iota_utilization_and_benchmarking_db[0].aws_rds_cluster_instance.this[0]
│ to include new values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for
│ .engine_version: was cty.StringVal("16.3"), but now cty.StringVal("14.9").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵
╷
│ Error: Provider produced inconsistent final plan
│ 
│ When expanding the plan for
│ module.use_cases.module.iota_utilization_and_benchmarking_db[0].aws_rds_cluster_instance.this[1]
│ to include new values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for
│ .engine_version: was cty.StringVal("16.3"), but now cty.StringVal("14.9").
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

Code Snippet

#########################
# Aurora DB AWS Cluster #
#########################
resource "aws_rds_cluster" "this" {
  cluster_identifier          ="dev-cluster-db"
  engine                      ="aurora-postgresql"
  engine_mode                 = "provisioned"
  engine_version              = 16,3
  database_name               = "postgres"
  master_username             = "**************"
  manage_master_user_password = true
  port                        = 5432
  apply_immediately           = true
  allow_major_version_upgrade = true
  db_instance_parameter_group_name    = aws_db_parameter_group.this.name
  iam_database_authentication_enabled = true
  network_type                        = "IPV4"
  storage_encrypted                   = true
  skip_final_snapshot                 = true

  serverlessv2_scaling_configuration {
    max_capacity = 5.0
    min_capacity = 0.5
  }
}

resource "aws_db_parameter_group" "this" {
  name   = "postgres"
  family = "aurora-postgresql16"
}

##################################
# Aurora DB AWS Cluster Instance #
##################################
resource "aws_rds_cluster_instance" "this" {
  count                                 = 2
  cluster_identifier                    = aws_rds_cluster.this.id
  instance_class                        = "db.serverless"
  engine                                = aws_rds_cluster.this.engine
  engine_version                        = aws_rds_cluster.this.engine_version
  apply_immediately                     = true
  auto_minor_version_upgrade            = true
  publicly_accessible                   = false
  ca_cert_identifier                    = "rds-ca-rsa2048-g1"
}

Steps to Reproduce

Run a plan which plans to modify a RDS DB version to 16.3.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 3 weeks ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 2 weeks ago

Similar #36004 Similar #36099