The element field of a browser test step contains the element locator, which auto-heals on the backend side, and constantly changes independently from any changes on the terraform config. Because of that, terraform is constantly prompting about these changes, which are confusing since these changes are not initiated by the user.
In response to this, we disabled the diff on the element field, preventing terraform from updating the element at all: https://github.com/DataDog/terraform-provider-datadog/pull/854.
We also introduced force_element_update to allow users to force updating the element if desired.
However the initial implementation didn't prevent the state from being updated when applying the config with other changes. The undesired diff kept reappearing. Moreover, force_element_update will always update the online resource, giving a false sense that the resource was modified.
This PR now prevents terraform from overriding the browser_step.*.params.element field in the local state with the response from the backend at all.
If force_element_update is set to true, it'll still keep in state the value from the config to track changes in the config.
If force_element_update is not set or set to false, terraform will just ignore the element part from the backend entirely.
If force_element_update is set to true, terraform won't prompt for any changes of element from the backend, and will update the online resource at every apply.
The
element
field of a browser test step contains the element locator, which auto-heals on the backend side, and constantly changes independently from any changes on the terraform config. Because of that, terraform is constantly prompting about these changes, which are confusing since these changes are not initiated by the user.In response to this, we disabled the diff on the
element
field, preventing terraform from updating the element at all: https://github.com/DataDog/terraform-provider-datadog/pull/854. We also introducedforce_element_update
to allow users to force updating theelement
if desired.However the initial implementation didn't prevent the state from being updated when applying the config with other changes. The undesired diff kept reappearing. Moreover,
force_element_update
will always update the online resource, giving a false sense that the resource was modified.This PR now prevents terraform from overriding the
browser_step.*.params.element
field in the local state with the response from the backend at all. Ifforce_element_update
is set to true, it'll still keep in state the value from the config to track changes in the config.If
force_element_update
is not set or set tofalse
, terraform will just ignore theelement
part from the backend entirely. Ifforce_element_update
is set totrue
, terraform won't prompt for any changes ofelement
from the backend, and will update the online resource at every apply.