Skip to content

Commit

Permalink
Add inline comment for lifecycle.ignore reasoning
Browse files Browse the repository at this point in the history
  • Loading branch information
199201shubhamsahu committed Oct 30, 2023
1 parent f5c1dda commit dfbabfb
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ resource "google_alloydb_cluster" "secondary" {

deletion_policy = "FORCE"

# Need lifecycle.ignore_changes because instance_type is an immutable field.
# And when promoting cluster from SECONDARY to PRIMARY, the instance_type of the associated secondary instance also changes and becomes PRIMARY.
# And we do not want terraform to destroy and create the instance because the field is immutable
lifecycle {
ignore_changes = [instance_type]
}
Expand Down

0 comments on commit dfbabfb

Please sign in to comment.