Skip to content

Commit d8c9959

Browse files
authored
fix: Ignore changes to root_password (#279)
root_password can only be set by the provider when the instance is provisioned and it seems that even if the provider could read the password then one would not wish to destroy and recreate the instance because the password did not match what was in Terraform. This is specifically relevant to emergency maintenance where somebody might have to re-import a cloned version of the SQL server into state in a cleanup exercise. The imported server has a null root_password because that is what the provider has to set it to on import. The password currently present in the state in this scenario will force a destroy and create of the instance because of this change. The way to avoid this is to ignore changes for root_password Co-authored-by: Andy Smith <[email protected]>
1 parent ab8c768 commit d8c9959

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

modules/mssql/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ resource "google_sql_database_instance" "default" {
118118

119119
lifecycle {
120120
ignore_changes = [
121-
settings[0].disk_size
121+
settings[0].disk_size,
122+
root_password
122123
]
123124
}
124125

0 commit comments

Comments
 (0)