Skip to content

RDS: Automatic minor version upgrade

Before you begin

Affected versions

  • Anyone using args-rds-aurora version 0.4.1 or earlier with no changes on default setup
  • Anyone with engine_version set to a minor version and auto_minor_version_upgrade set to true
  • Note: auto_minor_version_upgrade defaults to true

Rationale

The current default in args-rds-aurora is a specific minor version to use when creating a database. Because the default for auto_minor_version_upgrade is true AWS will upgrade your database from ex. 13.6 (the default in args-rds-aurora) to 13.7 when the maintenance window allows for it.

When this happens it will generate a difference between IaC and the actual deployed version, and you will be asked to downgrade the database the next time terraform apply is applied to the database stack.

This upgrade sets the engine_version to a major version by default and lets AWS handle automatic upgrade of minor versions. Once applied there will be no difference between IaC and deployed version.

Step 1: Upgrade to latest args-rds-aurora

Changes in all steps apply to the RDS configuration in the database stack.

Before:

source = "git@github.com:oslokommune/golden-path-iac//terraform/modules/args-rds-aurora?ref=args-rds-aurora-v0.4.0"

After:

source = "git@github.com:oslokommune/golden-path-iac//terraform/modules/args-rds-aurora?ref=args-rds-aurora-v0.5.0"

See Golden Path releases for the latest module version.

Step 2: Set engine version

Set the engine version to the default version:

engine_version = local.args_rds.engine_version

Or, set it to a specific major version:

engine_version = "13"

Or, set it to a specific minor version (auto_minor_version_upgrade should then be set to false):

engine_version = "13.6"

Step 3: Allow auto-upgrade

Add the default:

auto_minor_version_upgrade = local.args_rds.auto_minor_version_upgrade

Or disallow auto-upgrade to maintain full control over version:

auto_minor_version_upgrade = false

The RDS setup in pirates-iac implements the changes and can serve as a reference.

Step 4: Apply upgrade

Install the new version of args-rds-aurora and apply the changes:

terraform init
terraform apply

Commit and push the changes to IaC.