I’ve just added sticky_settings to my setup, and when running the plan it shows a couple of sticky settings that’s been automatically added by Azure, that are not visible in the portal eg. APPINSIGHTS_SNAPSHOTFEATURE_VERSION added by Application Insights
After adding the sticky_settings block, all the automatically added settings that’s currently sticky, but not defined in my code are shown as removed.
I’d like to ignore the changes of sticky settings made by eg. application insights, but I can’t figure out the syntax.
ignore_changes = [
sticky_settings[0].app_setting_names["APPINSIGHTS_SNAPSHOTFEATURE_VERSION"]
]
│ Error: Invalid index
│
│ on app-backend.tf line 82, in resource "azurerm_windows_web_app" "backend":
│ 82: sticky_settings[0].app_setting_names["APPINSIGHTS_SNAPSHOTFEATURE_VERSION"]
│
│ The given key does not identify an element in this collection value: a number is required.
I’m not sure if that means I need to reference the APPINSIGHTS_… by its index, and then how would I determine the index. Thought I might need to use [0] on app_setting_names as well.
ignore_changes = [
sticky_settings[0].app_setting_names[0].APPINSIGHTS_SNAPSHOTFEATURE_VERSION
]
│ Error: Unsupported attribute
│
│ on app-backend.tf line 82, in resource "azurerm_windows_web_app" "backend":
│ 82: sticky_settings[0].app_setting_names[0].APPINSIGHTS_SNAPSHOTFEATURE_VERSION
│
│ Can't access attributes on a primitive-typed value (string).
I also tried sticky_settings[0].app_setting_names[“APPINSIGHTS_SNAPSHOTFEATURE_VERSION”], and using [*]'s instead of [0]'s without any success.
Any ideas on how I might achieve this?
I’m on terraform 1.1.8 and azurerm 3.20.0