Inverse 'ignore_changes' - ignore all EXCEPT

Hi All,

We have an interesting situation with azure web apps / function apps and the app_settings block.

There are certain settings that we want to control but the rest we (as infrastructure people) ‘don’t care about’.

for example, we want to always control the timezone so:

app_settings {
WEBSITE_TIME_ZONE = “GMT Standard Time”
}

The developer pipeline will then put a number of extra app settings in the app for it to run.

If we run a plan we will see TF wanting to remove all the developer settings

So, we bring in lifecycle ignore_changes :

lifecycle {
ignore_changes = [
app_settings
]
}

However, we have now ‘lost control’ of the WEBSITE_TIME_ZONE and cannot reset it should the developer pipelines change the WEBSITE_TIME_ZONE.

We can ignore individual parameters via:

lifecycle {
ignore_changes = [
app_settings[“FUNCTIONS_EXTENSION_VERSION”]
]
}

but we have to know all the (somewhat random) app settings the developers will set

Is there a way of saying ‘ignore everything except these settings’ - i.e.

lifecycle {
ignore_changes = [
app_settings
]
override_ignore_changes = [
app_settings[“WEBSITE_TIME_ZONE”]
]}

psuedo-code I know… but would be very useful.

Many Thanks for reading,

Alex