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

Add support for user handoff notification rules #875

Merged

Conversation

imjaroiswebdev
Copy link
Contributor

@imjaroiswebdev imjaroiswebdev commented May 23, 2024

Add support for User Handoff Notification Rules

This is how it will work...

resource "pagerduty_user" "example" {
  name  = "Earline Greenholt"
  email = "[email protected]"
}

resource "pagerduty_user_contact_method" "phone" {
  user_id      = pagerduty_user.example.id
  type         = "phone_contact_method"
  country_code = "+1"
  address      = "2025550199"
  label        = "Work"
}

resource "pagerduty_user_handoff_notification_rule" "example-oncall-offcall" {
  user_id                   = pagerduty_user.example.id
  handoff_type              = "both"
  notify_advance_in_minutes = 180
  contact_method {
    id   = pagerduty_user_contact_method.phone.id
    type = pagerduty_user_contact_method.phone.type
  }
}

Documentation preview

image

New acceptance tests introduced...

TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -count=1 -run TestAccPagerDutyUserHandoffNotificationRule -timeout 120m
?       github.com/PagerDuty/terraform-provider-pagerduty       [no test files]
testing: warning: no tests to run
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/pagerduty     0.539s [no tests to run]
=== RUN   TestAccPagerDutyUserHandoffNotificationRule_import
--- PASS: TestAccPagerDutyUserHandoffNotificationRule_import (13.42s)
=== RUN   TestAccPagerDutyUserHandoffNotificationRule_Basic
--- PASS: TestAccPagerDutyUserHandoffNotificationRule_Basic (17.20s)
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/pagerdutyplugin       31.362s
testing: warning: no tests to run
PASS
ok      github.com/PagerDuty/terraform-provider-pagerduty/util  0.837s [no tests to run]

⚠️ Depends on...

PagerDuty/go-pagerduty#528 must be merged before moving on with this PR merge.

@imjaroiswebdev imjaroiswebdev requested a review from cjgajard May 23, 2024 00:06
go.mod Outdated Show resolved Hide resolved
@imjaroiswebdev imjaroiswebdev changed the title Support user handoff notif Add support for user handoff notification rules May 23, 2024
@imjaroiswebdev imjaroiswebdev marked this pull request as ready for review May 24, 2024 21:49
@imjaroiswebdev imjaroiswebdev merged commit a90d94f into PagerDuty:master May 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants