-
Notifications
You must be signed in to change notification settings - Fork 8
Description
When an RDS instance is created, it will automatically upgrade the minor version which causes state file issues. This happens because AWS automatically upgrades the RDS engine version to the latest version for security and performance reasons.
For example, this repo currently has engine_version set to “13.4”, and a new deployment will work as expected (at 13.4). However, AWS will eventually upgrade this to “13.7” (I think during a maintenance window, likely hours after you were last looking at the base deployment).
This can cause upleasant surprises when you go to update your base stack and it thinks you want to downgrade (which ultimately fails):
# module.main.module.rds.aws_db_instance.this will be updated in-place
~ resource "aws_db_instance" "this" {
~ engine_version = "13.7" -> "13.4"
id = "ocpython-rds"
name = "postgres"
tags = {}
# (49 unchanged attributes hidden)
}
To prevent this issue, we should be able to set the auto_minor_version_upgrade parameter to false when creating the RDS instance, which will prevent automatic minor version upgrades.