UserNotificationRule
A notification rule configures where and when a PagerDuty user is notified when a triggered incident is assigned to him. Unique notification rules can be created for both high and low-urgency incidents.
Example Usage
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;
class MyStack : Stack
{
public MyStack()
{
var example = new Pagerduty.User("example", new Pagerduty.UserArgs
{
Email = "125.greenholt.earline@graham.name",
});
var email = new Pagerduty.UserContactMethod("email", new Pagerduty.UserContactMethodArgs
{
UserId = example.Id,
Type = "email_contact_method",
Address = "foo@bar.com",
Label = "Work",
});
var phone = new Pagerduty.UserContactMethod("phone", new Pagerduty.UserContactMethodArgs
{
UserId = example.Id,
Type = "phone_contact_method",
CountryCode = "+1",
Address = "2025550199",
Label = "Work",
});
var sms = new Pagerduty.UserContactMethod("sms", new Pagerduty.UserContactMethodArgs
{
UserId = example.Id,
Type = "sms_contact_method",
CountryCode = "+1",
Address = "2025550199",
Label = "Work",
});
var highUrgencyPhone = new Pagerduty.UserNotificationRule("highUrgencyPhone", new Pagerduty.UserNotificationRuleArgs
{
UserId = example.Id,
StartDelayInMinutes = 1,
Urgency = "high",
ContactMethod = new Pagerduty.Inputs.UserNotificationRuleContactMethodArgs
{
Type = "phone_contact_method",
Id = phone.Id,
},
});
var lowUrgencyEmail = new Pagerduty.UserNotificationRule("lowUrgencyEmail", new Pagerduty.UserNotificationRuleArgs
{
UserId = example.Id,
StartDelayInMinutes = 1,
Urgency = "low",
ContactMethod = new Pagerduty.Inputs.UserNotificationRuleContactMethodArgs
{
Type = "email_contact_method",
Id = email.Id,
},
});
var lowUrgencySms = new Pagerduty.UserNotificationRule("lowUrgencySms", new Pagerduty.UserNotificationRuleArgs
{
UserId = example.Id,
StartDelayInMinutes = 10,
Urgency = "low",
ContactMethod = new Pagerduty.Inputs.UserNotificationRuleContactMethodArgs
{
Type = "sms_contact_method",
Id = sms.Id,
},
});
}
}
Coming soon!
import pulumi
import pulumi_pagerduty as pagerduty
example = pagerduty.User("example", email="125.greenholt.earline@graham.name")
email = pagerduty.UserContactMethod("email",
user_id=example.id,
type="email_contact_method",
address="foo@bar.com",
label="Work")
phone = pagerduty.UserContactMethod("phone",
user_id=example.id,
type="phone_contact_method",
country_code="+1",
address="2025550199",
label="Work")
sms = pagerduty.UserContactMethod("sms",
user_id=example.id,
type="sms_contact_method",
country_code="+1",
address="2025550199",
label="Work")
high_urgency_phone = pagerduty.UserNotificationRule("highUrgencyPhone",
user_id=example.id,
start_delay_in_minutes=1,
urgency="high",
contact_method={
"type": "phone_contact_method",
"id": phone.id,
})
low_urgency_email = pagerduty.UserNotificationRule("lowUrgencyEmail",
user_id=example.id,
start_delay_in_minutes=1,
urgency="low",
contact_method={
"type": "email_contact_method",
"id": email.id,
})
low_urgency_sms = pagerduty.UserNotificationRule("lowUrgencySms",
user_id=example.id,
start_delay_in_minutes=10,
urgency="low",
contact_method={
"type": "sms_contact_method",
"id": sms.id,
})import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
const example = new pagerduty.User("example", {email: "125.greenholt.earline@graham.name"});
const email = new pagerduty.UserContactMethod("email", {
userId: example.id,
type: "email_contact_method",
address: "foo@bar.com",
label: "Work",
});
const phone = new pagerduty.UserContactMethod("phone", {
userId: example.id,
type: "phone_contact_method",
countryCode: "+1",
address: "2025550199",
label: "Work",
});
const sms = new pagerduty.UserContactMethod("sms", {
userId: example.id,
type: "sms_contact_method",
countryCode: "+1",
address: "2025550199",
label: "Work",
});
const highUrgencyPhone = new pagerduty.UserNotificationRule("highUrgencyPhone", {
userId: example.id,
startDelayInMinutes: 1,
urgency: "high",
contactMethod: {
type: "phone_contact_method",
id: phone.id,
},
});
const lowUrgencyEmail = new pagerduty.UserNotificationRule("lowUrgencyEmail", {
userId: example.id,
startDelayInMinutes: 1,
urgency: "low",
contactMethod: {
type: "email_contact_method",
id: email.id,
},
});
const lowUrgencySms = new pagerduty.UserNotificationRule("lowUrgencySms", {
userId: example.id,
startDelayInMinutes: 10,
urgency: "low",
contactMethod: {
type: "sms_contact_method",
id: sms.id,
},
});Create a UserNotificationRule Resource
new UserNotificationRule(name: string, args: UserNotificationRuleArgs, opts?: CustomResourceOptions);def UserNotificationRule(resource_name, opts=None, contact_method=None, start_delay_in_minutes=None, urgency=None, user_id=None, __props__=None);func NewUserNotificationRule(ctx *Context, name string, args UserNotificationRuleArgs, opts ...ResourceOption) (*UserNotificationRule, error)public UserNotificationRule(string name, UserNotificationRuleArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args UserNotificationRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args UserNotificationRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserNotificationRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
UserNotificationRule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The UserNotificationRule resource accepts the following input properties:
- Contact
Method UserNotification Rule Contact Method Args A contact method block, configured as a block described below.
- Start
Delay intIn Minutes The delay before firing the rule, in minutes.
- Urgency string
Which incident urgency this rule is used for. Account must have the
urgenciesability to have a low urgency notification rule. Can behighorlow.- User
Id string The ID of the user.
- Contact
Method UserNotification Rule Contact Method A contact method block, configured as a block described below.
- Start
Delay intIn Minutes The delay before firing the rule, in minutes.
- Urgency string
Which incident urgency this rule is used for. Account must have the
urgenciesability to have a low urgency notification rule. Can behighorlow.- User
Id string The ID of the user.
- contact
Method UserNotification Rule Contact Method A contact method block, configured as a block described below.
- start
Delay numberIn Minutes The delay before firing the rule, in minutes.
- urgency string
Which incident urgency this rule is used for. Account must have the
urgenciesability to have a low urgency notification rule. Can behighorlow.- user
Id string The ID of the user.
- contact_
method Dict[UserNotification Rule Contact Method] A contact method block, configured as a block described below.
- start_
delay_ floatin_ minutes The delay before firing the rule, in minutes.
- urgency str
Which incident urgency this rule is used for. Account must have the
urgenciesability to have a low urgency notification rule. Can behighorlow.- user_
id str The ID of the user.
Outputs
All input properties are implicitly available as output properties. Additionally, the UserNotificationRule resource produces the following output properties:
Look up an Existing UserNotificationRule Resource
Get an existing UserNotificationRule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: UserNotificationRuleState, opts?: CustomResourceOptions): UserNotificationRulestatic get(resource_name, id, opts=None, contact_method=None, start_delay_in_minutes=None, urgency=None, user_id=None, __props__=None);func GetUserNotificationRule(ctx *Context, name string, id IDInput, state *UserNotificationRuleState, opts ...ResourceOption) (*UserNotificationRule, error)public static UserNotificationRule Get(string name, Input<string> id, UserNotificationRuleState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Contact
Method UserNotification Rule Contact Method Args A contact method block, configured as a block described below.
- Start
Delay intIn Minutes The delay before firing the rule, in minutes.
- Urgency string
Which incident urgency this rule is used for. Account must have the
urgenciesability to have a low urgency notification rule. Can behighorlow.- User
Id string The ID of the user.
- Contact
Method UserNotification Rule Contact Method A contact method block, configured as a block described below.
- Start
Delay intIn Minutes The delay before firing the rule, in minutes.
- Urgency string
Which incident urgency this rule is used for. Account must have the
urgenciesability to have a low urgency notification rule. Can behighorlow.- User
Id string The ID of the user.
- contact
Method UserNotification Rule Contact Method A contact method block, configured as a block described below.
- start
Delay numberIn Minutes The delay before firing the rule, in minutes.
- urgency string
Which incident urgency this rule is used for. Account must have the
urgenciesability to have a low urgency notification rule. Can behighorlow.- user
Id string The ID of the user.
- contact_
method Dict[UserNotification Rule Contact Method] A contact method block, configured as a block described below.
- start_
delay_ floatin_ minutes The delay before firing the rule, in minutes.
- urgency str
Which incident urgency this rule is used for. Account must have the
urgenciesability to have a low urgency notification rule. Can behighorlow.- user_
id str The ID of the user.
Supporting Types
UserNotificationRuleContactMethod
Package Details
- Repository
- https://github.com/pulumi/pulumi-pagerduty
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
pagerdutyTerraform Provider.