opsgenie / terraform-provider-opsgenie

Terraform OpsGenie provider
https://registry.terraform.io/providers/opsgenie/opsgenie/latest/docs
Mozilla Public License 2.0
100 stars 136 forks source link

opsgenie_notification_policy not validating that all the expected fields are defined #355

Closed plaes closed 10 months ago

plaes commented 1 year ago

Hi there,

When rolling out opsgenie_notification_policy, it doesn't check at client side whether all expected fields are correctly, but the invalid data will be sent to server where it fails with error 422.

$ terraform -v
Terraform v1.3.7
on darwin_arm64
+ provider registry.terraform.io/opsgenie/opsgenie v0.6.18

Affected Resource(s)

Please list the resources as a list, for example:

Terraform Configuration Files

resource "opsgenie_notification_policy" "opsteam_workhours" {
  name               = "working-hours"
  team_id            = lookup(resource.opsgenie_team.teams, "operations").id
  policy_description = "Enable alerts during working hours"

  filter {}
  time_restriction {
    type = "weekday-and-time-of-day"
    restrictions {
      end_day    = "monday"
      end_hour   = 18
      end_min    = 0
      start_day  = "monday"
      start_hour = 10
      start_min  = 0
    }
  }
}