This is my first post - after several years of reading, so hopefully I do not miss something.
I’m using terraform azurerm_linux_web_app to deploy some app services.
As their content is deployed via ci pipelines there are some attributes I want/have to ignore during terraform plan / apply
So my tf module has the following lifecycle:
lifecycle {
ignore_changes = [
app_settings["section1__setting"],
app_settings["section2__setting"],
app_settings["just_another_setting"],
site_config["app_command_line"]
]
}
On a first glance this is working like a charm. But now I added some allowed regions to site_config.cors like:
site_config {
cors {
allowed_origins = var.frontendWebAppURis # a list of strings
support_credentials = false
}
}
When I run terraform plan
there are no changes to be made.
If I remove site_config["app_command_line"]
from ignore list the plan will contain all entries to add.
What am I missing in “ignore_changes” syntax for map keys ?
References:
- TF azurerm resource docu: Terraform Registry
- TF lifecycle docu: The lifecycle Meta-Argument - Configuration Language | Terraform | HashiCorp Developer
- about a dozen of stack overflow threads
- terraform github issues related to ignore_changes
PS: This is a repost of my question on stackoverflow. Initially I expected a fast reaction time there which did not happen. I will gladly share the anser there as well.