A contact method is a contact method for a PagerDuty user (email, phone or SMS).
resource "pagerduty_user" "example" {
name = "Earline Greenholt"
email = "[email protected]"
teams = ["${pagerduty_team.example.id}"]
}
resource "pagerduty_user_contact_method" "email" {
user_id = "${pagerduty_user.example.id}"
type = "email_contact_method"
address = "[email protected]"
label = "Work"
}
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_contact_method" "sms" {
user_id = "${pagerduty_user.example.id}"
type = "sms_contact_method"
country_code = "+1"
address = "2025550199"
label = "Work"
}
The following arguments are supported:
user_id - (Required) The ID of the user. type - (Required) The contact method type. May be (email_contact_method, phone_contact_method, sms_contact_method). send_short_email - (Optional) Send an abbreviated email message instead of the standard email output. country_code - (Optional) The 1-to-3 digit country calling code. Required when using phone_contact_method or sms_contact_method. label - (Required) The label (e.g., "Work", "Mobile", etc.). address - (Required) The "address" to deliver to: email, phone number, etc., depending on the type. The following attributes are exported:
id - The ID of the contact method. blacklisted - If true, this phone has been blacklisted by PagerDuty and no messages will be sent to it. enabled - If true, this phone is capable of receiving SMS messages. Contact methods can be imported using the user_id and the id, e.g.
$ terraform import pagerduty_user_contact_method.main PLBP09X:PLBP09X
© 2018 HashiCorpLicensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/pagerduty/r/user_contact_method.html