Skip to content

fix(terraform): pin Aurora engine version to the running 13.23 - #387

Open
geekbrother wants to merge 1 commit into
mainfrom
fix/pin-rds-engine-version
Open

geekbrother wants to merge 1 commit into
mainfrom
fix/pin-rds-engine-version

Conversation

@geekbrother

Copy link
Copy Markdown
Member

Both Aurora clusters declared engine_version = "13.18" while AWS had auto-upgraded them to 13.23, so every plan queued a minor-version rollback across all four resources:

  # module.database_cluster.aws_rds_cluster.this[0] will be updated in-place
      ~ engine_version = "13.23" -> "13.18"
  # module.database_cluster.aws_rds_cluster_instance.this["1"] will be updated in-place
  # module.tenant_database_cluster.aws_rds_cluster.this[0] will be updated in-place
  # module.tenant_database_cluster.aws_rds_cluster_instance.this["1"] will be updated in-place

(from the staging plan on #384, the first working plan since March 2025 — visible in run 34378756082)

The drift has been harmless only because plan-staging was broken that whole time. The next working apply would have executed it against both staging databases.

Change

  • engine_version → "13.23" on both clusters, matching what they actually run, so the plan is a no-op.
  • auto_minor_version_upgrade = false, because that is what makes the pin hold. Left at the AWS default of true, AWS bumps the minor again at the next maintenance window and the drift comes straight back. Minor upgrades become a deliberate bump of this value.
  • allow_major_version_upgrade stays true, unchanged.

terraform fmt -check -recursive is clean (the module block realigned, which is why the diff is wider than the two lines).

Important

Confirm prod's actual version before any prod apply. ci_terraform only plans staging, and this config is shared across both workspaces via local.environment. 13.23 is verified for staging from the plan above; if prod sits on a different minor, this pin becomes an upgrade there rather than a no-op. Worth a quick look at the echo-server-prod workspace or the RDS console.

Merge order

Land this before #386. #386 makes auto_deploy work end to end, including the staging terraform apply that had never been reached — so with this merged first, that first working apply has nothing to roll back.

🤖 Generated with Claude Code

Both clusters said engine_version = "13.18" while AWS had auto-upgraded them
to 13.23, so every plan queued a minor-version rollback on all four
resources:

    ~ engine_version = "13.23" -> "13.18"

That drift was harmless only because the plan job has been broken since March
2025 — the next working apply would have executed it. Pinned to what the
clusters actually run, and auto_minor_version_upgrade = false so the pin
holds; without it AWS bumps the minor again at the next maintenance window
and the drift returns. Minor upgrades become a deliberate bump of this value.

allow_major_version_upgrade stays true, unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment thread terraform/main.tf
# Pinned to what the cluster actually runs. AWS auto-upgraded it to 13.23 while this
# still said 13.18, so every plan queued an engine_version rollback. Minor upgrades
# are a deliberate bump here now, otherwise the drift comes straight back.
engine_version = "13.23"

@arminx86-77616c arminx86-77616c Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazon will upgrade this if needed even if you disable auto_minor_version_upgrade as described in the docs, and this is the last version in the EndOf Standard support version in 13 family so later versions might be critical upgrades I assume.

Amazon Aurora will apply a minor version upgrade even if you haven't enabled the Auto minor version upgrade option
Ref to docs


Now that we are touching the version, it worth checking this:
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraPostgreSQLReleaseNotes/aurorapostgresql-release-calendar.html
On Feb 2026, `Aurora end of standard support date` for 13.23, time to evaluate the v14 and later ones.
We do have a single instance here, based on what I experieced aith aws Aurora, if case of incident, it takes 5-10 minutes for a new instance to get provisioned and running. are we ok to consider a second instance? like:
instances = {
  1 = {}
  2 = {}
}

The second instance automatically becomes a read-only replica
additional instances in an Aurora cluster automatically get established as replicas of the writer (ref)
so in case of any service outage in the writer, AWS will promptoe the reader as the new writer so we will have more resiliency against AZ outage or similar cases and we can consider it only on Prod.

Aurora automatically promotes one of the reader instances to take its place as the new writer.
ref

This branch was successfully deployed

1 active deployment
staging — 06e8a466 Deployed Sep 10, 2026 by geekbrother via plan-staging #268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants