Hi,
Is it possible to configure so that changes made outside of Terraform wont be corrected in upcoming Terraform runs, but if a change is done within the Terraform configuration it will actually apply it?
Consider the following:
resource "azurerm_windows_virtual_machine_scale_set" "windows_scale_set" {
lifecycle {
ignore_changes = [
source_image_id
]
}
source_image_id = "source_image_id_1"
....
}
Then the VMSS gets created with source_image_id_1
and later, when changed outside of Terraform, the next Terraform run will not try to fix it (change it back to what’s inside of the configuration). However, I’d like for Terraform to change it if the value is not the same inside of the Terraform configuration anymore, for example if the attribute value of source_image_id
was manually changed within the configuration to source_image_id_2
.
In other words, if the attribute included in the ignore_changes
lifecycle block gets changed manually, inside of the Terraform configuration, it will actually get updated accordingly. But if it stays the same it will never try to fix it back to that same value, in consecutive Terraform runs, when changes have done outside of Terraform.
Would this be possible? I don’t necessarily need to use the ignore_changes
or lifecycle
block for this, if there’s another way, I’m open for suggestions.