Skip to content

fix(terraform/aws): major-only RDS engine_version pin to stop downgrade failures - #1375

Merged
cristim merged 1 commit into
mainfrom
fix/rds-engine-version-drift
Jul 16, 2026
Merged

cristim merged 1 commit into
mainfrom
fix/rds-engine-version-drift

Conversation

@cristim

@cristim cristim commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

  • RDS auto-minor-upgraded the dev instance from 16.6 to 16.13; Terraform then attempted to downgrade back to 16.6, which RDS rejected: InvalidParameterCombination: Cannot find upgrade path from 16.13 to 16.6.
  • Root cause: all six engine_version pins were set to the exact minor "16.6". Any RDS auto-minor upgrade creates an irreconcilable drift -- Terraform sees a config mismatch and tries a downgrade that the API refuses.
  • Fix: change all six pins from "16.6" to "16" (major-only). The AWS provider v5 (5.100.0, confirmed in lockfile) stores the real minor version in engine_version_actual and suppresses diff when the configured value is a major-only prefix, so no downgrade is ever attempted and future auto-minor upgrades remain transparent.
  • auto_minor_version_upgrade = true is now set explicitly in the module resource with a comment, making the intent self-describing.

Files changed

  • terraform/modules/database/aws/main.tf -- added explicit auto_minor_version_upgrade = true with explanatory comment
  • terraform/modules/database/aws/variables.tf -- pin changed to "16", description updated
  • terraform/environments/aws/variables.tf -- pin changed to "16", description updated
  • terraform/environments/aws/dev.tfvars.example -- pin changed to "16"
  • terraform/environments/aws/github-dev.tfvars -- pin changed to "16"
  • terraform/environments/aws/github-prod.tfvars -- pin changed to "16"
  • terraform/environments/aws/github-staging.tfvars -- pin changed to "16"

Gate results

  • terraform fmt -check -recursive on both touched dirs: exit 0
  • terraform init -backend=false && terraform validate in terraform/modules/database/aws: exit 0
  • terraform init -backend=false && terraform validate in terraform/environments/aws: exit 0

Test plan

  • CI "Validate Terraform (aws)" passes on this PR
  • terraform plan in the dev environment shows no engine_version change for the existing 16.13 instance
  • Next deploy does not attempt a downgrade

Addresses the AWS deploy failure in #1372.

…de failures

RDS auto-minor-upgraded cudly-dev-426fc8af-postgres from 16.6 to 16.13.
Terraform then tried to downgrade to 16.6, which RDS rejected with
InvalidParameterCombination: Cannot find upgrade path from 16.13 to 16.6.

Switching all six engine_version pins from "16.6" to "16" (major-only).
The AWS provider v5 resolves a major-only value via engine_version_actual
and suppresses diff on auto-minor upgrades, so no downgrade is ever
attempted. auto_minor_version_upgrade is now explicit in the module to
make the intent self-describing.

Addresses the AWS deploy failure in #1372.
@cristim cristim added triaged Item has been triaged priority/p2 Backlog-worthy severity/high Significant harm urgency/now Drop other things impact/internal Team-internal only effort/xs Trivial / one-liner type/bug Defect labels Jul 16, 2026
@cristim

cristim commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8f8c3e61-27e2-4798-ad4c-9f2556f97e75

📥 Commits

Reviewing files that changed from the base of the PR and between 157f9e2 and 32ff7ae.

📒 Files selected for processing (7)
  • terraform/environments/aws/dev.tfvars.example
  • terraform/environments/aws/github-dev.tfvars
  • terraform/environments/aws/github-prod.tfvars
  • terraform/environments/aws/github-staging.tfvars
  • terraform/environments/aws/variables.tf
  • terraform/modules/database/aws/main.tf
  • terraform/modules/database/aws/variables.tf
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rds-engine-version-drift

Comment @coderabbitai help to get the list of available commands.

@cristim
cristim merged commit 9b3c8bc into main Jul 16, 2026
13 of 16 checks passed
@cristim
cristim deleted the fix/rds-engine-version-drift branch July 16, 2026 16:51
@cristim

cristim commented Jul 16, 2026

Copy link
Copy Markdown
Member Author

Merged to main: RDS engine_version pins switched from exact-minor 16.6 to major-only 16 across all six locations (module default, env default, 3 github tfvars, example), with auto_minor_version_upgrade explicit and the convention documented. Provider v5.100.0 prefix-suppression verified, so the live 16.13 instance satisfies the pin and no downgrade is ever attempted. This fixes the AWS-half of #1372 (Deploy to AWS Lambda failing on ModifyDBInstance 16.13->16.6). Next AWS deploy on main will confirm; GCP half already confirmed fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner impact/internal Team-internal only priority/p2 Backlog-worthy severity/high Significant harm triaged Item has been triaged type/bug Defect urgency/now Drop other things

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant