terraform-provider-datadog icon indicating copy to clipboard operation
terraform-provider-datadog copied to clipboard

Error "Monitors not found or not supported SLO" should fail plan

Open matt-canty-dragon opened this issue 4 years ago • 1 comments

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 {

matt-canty-dragon avatar Jul 15 '20 13:07 matt-canty-dragon

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.

nmuesch avatar Sep 25 '20 21:09 nmuesch