Skip to content

No longer able to do minor version upgrades on aws_db_instance with read replicas #24887

Closed
@w0jnar

Description

@w0jnar

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v1.1.9
on linux_amd64
+ provider registry.terraform.io/hashicorp/aws v4.14.0

Affected Resource(s)

  • aws_db_instance

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

provider "aws" {
  region  = "us-west-1"
}

variable "postgres_engine_version" {
  type    = string
  default = "14.1"
}

variable "postgres_engine_version_replica" {
  type    = string
  default = "14.2"
}

resource "aws_db_instance" "example" {
  allocated_storage       = 10
  engine                  = "postgres"
  engine_version          = var.postgres_engine_version
  identifier              = "example"
  instance_class          = "db.t3.micro"
  username                = "postgres"
  password                = "password"
  skip_final_snapshot     = true
  backup_retention_period = 1
  apply_immediately       = true
}

resource "aws_db_instance" "example-replica" {
  #engine              = "postgres"
  #engine_version      = var.postgres_engine_version2
  identifier          = "example-replica"
  instance_class      = "db.t3.micro"
  replicate_source_db = aws_db_instance.example.arn
  apply_immediately   = true
}

Expected Behavior

Formerly, we could do minor version upgrades by upgrading the replica's engine version first, then upgrading the primary to match.

Actual Behavior

As of v4.0, engine and engine_version "Cannot be specified for a replica", so it cannot be set on the replica.
If you attempt the upgrade the primary, you receive:

Error: modifying DB Instance example: DBUpgradeDependencyFailure: One or more of the DB Instance's read replicas need to be upgraded: example-replica

The only solution we have in mind at the moment is to get rid of the replica, upgrade the primary, then recreate the replica, but that isn't ideal.

Steps to Reproduce

  1. terraform apply
  2. terraform apply -var postgres_engine_version=14.2

Important Factoids

Nothing in particular.

References

Metadata

Metadata

Assignees

Labels

bugAddresses a defect in current functionality.regressionPertains to a degraded workflow resulting from an upstream patch or internal enhancement.service/rdsIssues and PRs that pertain to the rds service.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions