AWS RDS Database Version is different than Terraform version

Viewed 1921

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?

  1. This is not the first time that I update my databases like this, since I destroy my infrastructure every weekend to limit my AWS costs.
  2. I solved the issue by changing my terraform Postgres version to 11.8, but still want to understand why the error happened in the first place.
1 Answers
Related