Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for RDS version control #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LifeCoder45
Copy link

This is a simple PR that does two thing:

  • Add support for enabling / disabling RDS minor version upgrades

  • Add support for specifying the RDS engine version itself (currently hardcoded)

The need for this is due to a few issues caused by the current hardcoded database version (13.7).

I added this module to my project last week, all was well. Today, when running terraform plan ... again, there is now a delta:

Terraform will perform the following actions:

  # module.retool.aws_db_instance.this will be updated in-place
  ~ resource "aws_db_instance" "this" {
      ~ engine_version                        = "13.10" -> "13.7"

In the past days, the DB hit its regularly scheduled maintenance window, and upgraded from 13.7 -> 13.10.

However, RDS does not support downgrades, as seen when attempting to apply:

│ Error: updating RDS DB Instance (retool-rds-instance): operation error RDS: ModifyDBInstance, https response error StatusCode: 400, RequestID: ~, api error InvalidParameterCombination: Cannot upgrade postgres from 13.10 to 13.7

So as the module is now, I only have one option, and that's to login to the AWS UI and disable "Auto minor version upgrade" under Maintenance, which is of course not idempotent, and contrary to Terraform principles.

This PR fixes the issue, by providing some flexibility:

  • a user can disable auto version upgrades (I intend to do this)
  • a user can leave upgrades in place, and when the situation I'm in occurs, instead update the newly exposed variable rds_engine_version to (in this case) 13.10

These are very minor changes, validated with:

aws_ecs (feature/rds-version-support) λ terraform validate
Success! The configuration is valid.

If possible, it'd be great to get this merged quickly, so I don't have to use the web UI / my own fork I don't intend to maintain.

Thanks!

@jamescarignan
Copy link

This would be very useful, as AWS has seemingly deprecated Postgres 13.7 - launching the infrastructure with this module is currently failing due to that version being unavailable, which is confirmed in the RDS web console. I note that 13.7-compatible Aurora still exists.

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