diff --git a/pagerduty/resource_pagerduty_ruleset_rule.go b/pagerduty/resource_pagerduty_ruleset_rule.go index d04770d6a..b1e50ffc9 100644 --- a/pagerduty/resource_pagerduty_ruleset_rule.go +++ b/pagerduty/resource_pagerduty_ruleset_rule.go @@ -88,6 +88,13 @@ func resourcePagerDutyRulesetRule() *schema.Resource { "timezone": { Type: schema.TypeString, Optional: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + _, err := time.LoadLocation(val.(string)) + if err != nil { + errs = append(errs, err) + } + return + }, }, "start_time": { Type: schema.TypeInt, diff --git a/pagerduty/resource_pagerduty_schedule.go b/pagerduty/resource_pagerduty_schedule.go index b3df4f741..5796c0633 100644 --- a/pagerduty/resource_pagerduty_schedule.go +++ b/pagerduty/resource_pagerduty_schedule.go @@ -48,6 +48,13 @@ func resourcePagerDutySchedule() *schema.Resource { "time_zone": { Type: schema.TypeString, Required: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + _, err := time.LoadLocation(val.(string)) + if err != nil { + errs = append(errs, err) + } + return + }, }, "overflow": { diff --git a/pagerduty/resource_pagerduty_service.go b/pagerduty/resource_pagerduty_service.go index 87417b7c5..4d02b8b6e 100644 --- a/pagerduty/resource_pagerduty_service.go +++ b/pagerduty/resource_pagerduty_service.go @@ -218,6 +218,13 @@ func resourcePagerDutyService() *schema.Resource { "time_zone": { Type: schema.TypeString, Optional: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + _, err := time.LoadLocation(val.(string)) + if err != nil { + errs = append(errs, err) + } + return + }, }, "start_time": { Type: schema.TypeString, diff --git a/pagerduty/resource_pagerduty_service_event_rule.go b/pagerduty/resource_pagerduty_service_event_rule.go index 0de6f5347..92b1d9989 100644 --- a/pagerduty/resource_pagerduty_service_event_rule.go +++ b/pagerduty/resource_pagerduty_service_event_rule.go @@ -88,6 +88,13 @@ func resourcePagerDutyServiceEventRule() *schema.Resource { "timezone": { Type: schema.TypeString, Optional: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + _, err := time.LoadLocation(val.(string)) + if err != nil { + errs = append(errs, err) + } + return + }, }, "start_time": { Type: schema.TypeInt, diff --git a/pagerduty/resource_pagerduty_user.go b/pagerduty/resource_pagerduty_user.go index 545270b37..8359fe8ef 100644 --- a/pagerduty/resource_pagerduty_user.go +++ b/pagerduty/resource_pagerduty_user.go @@ -81,6 +81,13 @@ func resourcePagerDutyUser() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, + ValidateFunc: func(val interface{}, key string) (warns []string, errs []error) { + _, err := time.LoadLocation(val.(string)) + if err != nil { + errs = append(errs, err) + } + return + }, }, "html_url": {