Upgrade AWS RDS PostgreSQL to 17

Proprietary

Upgrade engine_version from PostgreSQL 11 to 16 to 17 on aws_db_instance resources with engine = "postgres" and set allow_major_version_upgrade = true to permit the major version change.

org.openrewrite.terraform.aws.UpgradeAwsRdsPostgresToV17
mod run . --recipe=org.openrewrite.terraform.aws.UpgradeAwsRdsPostgresToV17

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Add content allow_major_version_upgrade = true to $.resource.aws_db_instance[?(@.engine == 'postgres' && @.engine_version =~ '1[1-6](\..*)?')]
  2. Change value $.resource.aws_db_instance[?(@.engine == 'postgres' && @.engine_version =~ '1[1-6](\..*)?')].allow_major_version_upgrade to true
  3. Change value $.resource.aws_db_instance[?(@.engine == 'postgres' && @.engine_version =~ '1[1-6](\..*)?')].engine_version to "17"