PagerDuty / terraform-provider-pagerduty

Terraform PagerDuty provider
https://www.terraform.io/docs/providers/pagerduty/
Mozilla Public License 2.0
206 stars 210 forks source link

Time zone validation is not aligned with the API #796

Closed drastawi closed 7 months ago

drastawi commented 9 months ago

The time zone validation that was introduced in https://github.com/PagerDuty/terraform-provider-pagerduty/pull/473 does not seem to be compatible with what is present on the API, for example US/Mountain is valid in the provider checks but it fails on the API. Likely the solution is to align the version of the tz info between the provider and the API.

Terraform Version

1.6.6

Affected Resource(s)

Terraform Configuration Files

timezone = "US/Mountain"

Debug Output

Panic Output

time zone is not a valid tzinfo identifier

Expected Behavior

Should throw an error

Actual Behavior

Calls the API

Steps to Reproduce

  1. terraform apply

References

https://stackoverflow.com/questions/64619841/time-loadlocation-gives-unknown-timezone-for-us-pacific-new-timezone

drastawi commented 7 months ago

In response to this the PagerDuty team posted the list of valid timezones on the API side. https://developer.pagerduty.com/docs/1afe25e9c94cb-types#time-zone To fix the validation we'd have to hard-code them into the provider code. @imjaroiswebdev