Reputation: 803
I'm learning how to use Terraform to manage my AWS Infrastructure.
Monday I created it all from scratch based on my Terraform Apply.
Tuesday (the next day) I wanted to update my app with some code changes (nothing that would affect the rest of the infrastructure, just my image in ECS) and got this error message in my terraform apply output:
Error: Error modifying DB Instance foo-staging-db: InvalidParameterCombination: Cannot upgrade postgres from 11.8 to 11.4
When I double checked my terraform database.tf
I saw this:
resource "aws_db_instance" "main" {
...
engine = "postgres"
engine_version = "11.4"
...
}
Does anybody has an idea of what could have happened here?
Upvotes: 4
Views: 9442
Reputation: 61
AWS use default setting auto_minor_version_upgrade=true
and tries to update your database.
You can do following to solve it
Method 1
Set flag to false explicitly using auto_minor_version_upgrade = false
Method 2
Use only first octet in version number engine_version = "11"
For more information https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/db_instance#engine_version
Upvotes: 6