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

Notification Policy delay until_minute cannot be 0 #222

Open MrFireman opened 3 years ago

MrFireman commented 3 years ago

Terraform Version

v0.14.2

Affected Resource(s)

Terraform Configuration Files

resource "opsgenie_notification_policy" "delay-alerts-until-working-hours" {

  name               = "Delay alerts until working hours"
  team_id            = opsgenie_team.team.id
  policy_description = "This policy is to ensure that alerts triggering outside of working hours will only alert during working hours."
  filter {
    type = "match-all"
  }

  delay_action {
    delay_option = "next-weekday"
    until_hour   = var.working_hours_start
    until_minute = var.working_hours_minute_start   # This value cannot be 0, so we can't set 9:00
  }
}

Expected Behavior

If we set the var.working_hours_start to be 9 and the var.working_hours_minute_start to be 0, we should have the alert policy to delay alerts until 9:00

Actual Behavior

This error message comes back from Opsgenie: Error: expected delay_action.0.until_minute to be in the range (1 - 59), got 0

Steps to Reproduce

  1. Create a opsgenie_notification_policy
  2. Create a delay_action block
  3. Set the until_minute to 0
  4. run terraform plan # this will result in the error
logicbomb421 commented 3 years ago

Having this issue as well.

Terraform v0.15.1
on darwin_amd64
+ provider registry.terraform.io/hashicorp/google v3.73.0
+ provider registry.terraform.io/opsgenie/opsgenie v0.6.5
simontabor commented 1 year ago

Any updates on this? Still a problem on provider 0.6.20

│ Error: expected delay_action.0.until_minute to be in the range (1 - 59), got 0
│
│   with opsgenie_notification_policy.policy_working_hours,
│   on policies.tf line 95, in resource "opsgenie_notification_policy" "policy_working_hours":
│   95:     until_minute = "00"
Baarsgaard commented 11 months ago

This should be closed as of: #379