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_monitor] Handle zero-based priority values #2455

Closed carlmartensen closed 2 months ago

carlmartensen commented 3 months ago

Add support for the upcoming zero-based monitor priority values. Terraform was storing priority = null as 0 in the state which means that a monitor priority changed from null to 0 would not detect a state change. To work around this, the schema type is switched from int to string so the change is detected. Users can still enter integer values for priority despite the schema change.

This solution has the drawback of terraform apply on priority=null pre-existing monitors stating a change was applied as the terraform state is updated from 0 to "". terraform plan correctly states no change in this case.

The implemented solution was discussed with the Api Clients team and determined to be the best path forward.