DataDog / terraform-provider-datadog

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

Add new downtime resource #2493

Open GauthierMenier opened 1 month ago

GauthierMenier commented 1 month ago

Datadog Terraform Provider Version

v3.41.0

Terraform Version

v1.3.10

What resources or data sources are affected?

datadog_downtime_schedule

Terraform Configuration Files

resource "datadog_downtime_schedule" "downtime_schedule_example" {
  scope = ""
  monitor_identifier {
    monitor_tags = ["night_downtime:true"]
  }
  recurring_schedule {
    recurrence {
      duration = local.downtimes.duration_night
      rrule    = "FREQ=DAILY;INTERVAL=1"
      start    = local.downtimes.start_date_night
    }
    timezone = "Europe/Paris"
  }
  display_timezone                 = "Europe/Paris"
  message                          = "test1"
  mute_first_recovery_notification = true
  notify_end_states                = ["alert", "warn"]
  notify_end_types                 = ["canceled", "expired"]
}

Relevant debug or panic output

422 Unprocessable Entity: errors:[V2 downtimes can only be accessed from a V2 endpoint]

Expected Behavior

Plan new resource

Actual Behavior

No response

Steps to Reproduce

No response

Important Factoids

No response

References

No response

nkzou commented 1 month ago

This is strange - the datadog_downtime_schedule resource should only be using v2 monitor endpoints. Are you trying to import a v1 monitor into this v2 resource?

GauthierMenier commented 1 month ago

I'm only using a terraform init/plan command to add a new resource.