DataDog / terraform-provider-datadog

Terraform Datadog provider
https://www.terraform.io/docs/providers/datadog/
Mozilla Public License 2.0
399 stars 375 forks source link

[datadog_synthetics_test] Fix `renotify_interval` drift when saving from UI #2457

Closed Drarig29 closed 2 months ago

Drarig29 commented 3 months ago

This is a PR stack, here is how it's organized:


When we save a test in the UI, the frontend saves the monitor_options with an additional property: notification_preset_name. Because of this, the monitor_options is not nil (HasMonitorOptions returns true) and as a result, monitor_options.renotify_interval is nil, which is saved as 0 in the local state. This causes drift with what's returned by the backend, which doesn't contain a monitor_options.renotify_interval at all.

This PR only saves the monitor_options in the local state when we do have actual properties to set (e.g. renotify_interval).