Skip to content

Commit

Permalink
fix: ignore changes on zone in pgsql module as per documentation (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-calabrese authored Dec 2, 2024
1 parent 0457561 commit df97631
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-worms-retire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"azure_postgres_server": patch
---

Ignore changes on zone to avoid relocating the database after first apply
5 changes: 5 additions & 0 deletions infra/modules/azure_postgres_server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ resource "azurerm_postgresql_flexible_server" "this" {
}

tags = var.tags

lifecycle {
# https://registry.terraform.io/providers/hashicorp/azurerm/4.5.0/docs/resources/postgresql_flexible_server#zone-1
ignore_changes = [zone, high_availability[0].standby_availability_zone]
}
}

#-----------------------------#
Expand Down

0 comments on commit df97631

Please sign in to comment.