Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to define time_window values > 1h #849

Closed
JelleSmet-TomTom opened this issue Apr 10, 2024 · 2 comments · Fixed by #876
Closed

Unable to define time_window values > 1h #849

JelleSmet-TomTom opened this issue Apr 10, 2024 · 2 comments · Fixed by #876

Comments

@JelleSmet-TomTom
Copy link

JelleSmet-TomTom commented Apr 10, 2024

Hi there,

Terraform Version

All versions. This is a provider error.

Affected Resource(s)

  • pagerduty_service

Terraform Configuration Files

resource "pagerduty_service" "service" {
  name                    = "Demo"
  description             = "Description"
  escalation_policy       = "abc"
  alert_creation          = "create_alerts_and_incidents"
  auto_resolve_timeout    = "null"
  acknowledgement_timeout = "null"
  alert_grouping_parameters {
    type = "content_based"
    config {
      aggregate   = "any"
      fields      = ["custom_details.business_service"]
      time_window = "86400"
    }
  }
}

Debug Output

n/a

Panic Output

n/a

Expected Behavior

The validation happening here should also allow for value 86400.
The PD api documentation does not mention this.
The UI allows this (important) value to be set:

image

When setting this value through the UI and then doing a GET on the service resource we can see the value to be 86400:

... snip ...
    "alert_grouping_parameters": {
      "type": "content_based",
      "config": {
        "fields": [
          "custom_details.some_field"
        ],
        "aggregate": "any",
        "time_window": 86400,
        "recommended_time_window": 300
      }
    },
... snip ...

Actual Behavior

  • providing 86400 as a value is refused by the Pagerduty provider through value validation.

Steps to Reproduce

  1. terraform apply

Important Factoids

n/a

References

n/a

@imjaroiswebdev
Copy link
Contributor

Hi @JelleSmet-TomTom, this is the expected functionality from our API, due the officially supported value for the setting pagerduty_service.alert_grouping_parameters.0.config.0.time_window through our REST API is >= 300 and <= 3600.

Screenshot 2024-05-29 at 2 47 12 PM

Therefore, being that the PagerDuty Terraform provider is an interface to interact with our REST APIs, then the time_window attribute accepts the supported input range.

@imjaroiswebdev
Copy link
Contributor

I'm reopening this issue because of #876 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants