terraform-provider-datadog
terraform-provider-datadog copied to clipboard
Error "Monitors not found or not supported SLO" should fail plan
Terraform Version
0.12.26
Affected Resource(s)
- datadog_service_level_objective
Expected Behavior
Plan phase should be able to detect that an incompatible monitor type has been associated with it.
Actual Behavior
Plan succeeds but the Apply fails
Error: error updating service level objective: 400 Bad Request: {"errors": ["Invalid payload: invalid monitor ids: 1234657, monitors not found or not supported SLO"]}
on modules/slo/main.tf line 1, in resource "datadog_service_level_objective" "this":
1: resource datadog_service_level_objective this {
Hey @matt-canty-dragon While there isn't an API available today to validate that a monitor type is supported in an SLO, I have made an PR here - https://github.com/DataDog/terraform-provider-datadog/pull/672 to check if all monitors in the "monitor_ids" list exist. This will ensure the "tf plan" fails if any monitor in that list doesn't exist.