Skip to content

Commit

Permalink
Fix RDS parameter group upgrading to create_before_destroy
Browse files Browse the repository at this point in the history
When upgrading to v0.10.0, we hit an undocumented breaking change - the
change of the RDS parameter group name necessitates Terraform recreate
the resource. But, the parameter group cannot be destroyed while the
running database is currently using it.

By creating a new parameter group first (before destroying the old one),
we can handle upgrades to the parameter group without causing breaking
changes.
  • Loading branch information
tdooner committed Oct 10, 2024
1 parent b7a4677 commit dab7db3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions infra/modules/database/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,8 @@ resource "aws_rds_cluster_parameter_group" "rds_query_logging" {
# Logs all statements that run 100ms or longer
value = "100"
}

lifecycle {
create_before_destroy = true
}
}

0 comments on commit dab7db3

Please sign in to comment.