1. Packages
  2. Pagerduty Provider
  3. API Docs
  4. UserHandoffNotificationRule
PagerDuty v4.17.0 published on Wednesday, Nov 20, 2024 by Pulumi

pagerduty.UserHandoffNotificationRule

Explore with Pulumi AI

pagerduty logo
PagerDuty v4.17.0 published on Wednesday, Nov 20, 2024 by Pulumi

    An user handoff notification rule is a rule that specifies how a user should be notified when they are handed off an incident.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as pagerduty from "@pulumi/pagerduty";
    
    const example = new pagerduty.User("example", {
        name: "Earline Greenholt",
        email: "125.greenholt.earline@foo.test",
    });
    const phone = new pagerduty.UserContactMethod("phone", {
        userId: example.id,
        type: "phone_contact_method",
        countryCode: 1,
        address: "2025550199",
        label: "Work",
    });
    const example_oncall_offcall = new pagerduty.UserHandoffNotificationRule("example-oncall-offcall", {
        userId: example.id,
        handoffType: "both",
        notifyAdvanceInMinutes: 180,
        contactMethod: {
            id: phone.id,
            type: phone.type,
        },
    });
    
    import pulumi
    import pulumi_pagerduty as pagerduty
    
    example = pagerduty.User("example",
        name="Earline Greenholt",
        email="125.greenholt.earline@foo.test")
    phone = pagerduty.UserContactMethod("phone",
        user_id=example.id,
        type="phone_contact_method",
        country_code=1,
        address="2025550199",
        label="Work")
    example_oncall_offcall = pagerduty.UserHandoffNotificationRule("example-oncall-offcall",
        user_id=example.id,
        handoff_type="both",
        notify_advance_in_minutes=180,
        contact_method={
            "id": phone.id,
            "type": phone.type,
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := pagerduty.NewUser(ctx, "example", &pagerduty.UserArgs{
    			Name:  pulumi.String("Earline Greenholt"),
    			Email: pulumi.String("125.greenholt.earline@foo.test"),
    		})
    		if err != nil {
    			return err
    		}
    		phone, err := pagerduty.NewUserContactMethod(ctx, "phone", &pagerduty.UserContactMethodArgs{
    			UserId:      example.ID(),
    			Type:        pulumi.String("phone_contact_method"),
    			CountryCode: pulumi.Int(1),
    			Address:     pulumi.String("2025550199"),
    			Label:       pulumi.String("Work"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewUserHandoffNotificationRule(ctx, "example-oncall-offcall", &pagerduty.UserHandoffNotificationRuleArgs{
    			UserId:                 example.ID(),
    			HandoffType:            pulumi.String("both"),
    			NotifyAdvanceInMinutes: pulumi.Int(180),
    			ContactMethod: &pagerduty.UserHandoffNotificationRuleContactMethodArgs{
    				Id:   phone.ID(),
    				Type: phone.Type,
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Pagerduty = Pulumi.Pagerduty;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Pagerduty.User("example", new()
        {
            Name = "Earline Greenholt",
            Email = "125.greenholt.earline@foo.test",
        });
    
        var phone = new Pagerduty.UserContactMethod("phone", new()
        {
            UserId = example.Id,
            Type = "phone_contact_method",
            CountryCode = 1,
            Address = "2025550199",
            Label = "Work",
        });
    
        var example_oncall_offcall = new Pagerduty.UserHandoffNotificationRule("example-oncall-offcall", new()
        {
            UserId = example.Id,
            HandoffType = "both",
            NotifyAdvanceInMinutes = 180,
            ContactMethod = new Pagerduty.Inputs.UserHandoffNotificationRuleContactMethodArgs
            {
                Id = phone.Id,
                Type = phone.Type,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.pagerduty.User;
    import com.pulumi.pagerduty.UserArgs;
    import com.pulumi.pagerduty.UserContactMethod;
    import com.pulumi.pagerduty.UserContactMethodArgs;
    import com.pulumi.pagerduty.UserHandoffNotificationRule;
    import com.pulumi.pagerduty.UserHandoffNotificationRuleArgs;
    import com.pulumi.pagerduty.inputs.UserHandoffNotificationRuleContactMethodArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var example = new User("example", UserArgs.builder()
                .name("Earline Greenholt")
                .email("125.greenholt.earline@foo.test")
                .build());
    
            var phone = new UserContactMethod("phone", UserContactMethodArgs.builder()
                .userId(example.id())
                .type("phone_contact_method")
                .countryCode("+1")
                .address("2025550199")
                .label("Work")
                .build());
    
            var example_oncall_offcall = new UserHandoffNotificationRule("example-oncall-offcall", UserHandoffNotificationRuleArgs.builder()
                .userId(example.id())
                .handoffType("both")
                .notifyAdvanceInMinutes(180)
                .contactMethod(UserHandoffNotificationRuleContactMethodArgs.builder()
                    .id(phone.id())
                    .type(phone.type())
                    .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: pagerduty:User
        properties:
          name: Earline Greenholt
          email: 125.greenholt.earline@foo.test
      phone:
        type: pagerduty:UserContactMethod
        properties:
          userId: ${example.id}
          type: phone_contact_method
          countryCode: '+1'
          address: '2025550199'
          label: Work
      example-oncall-offcall:
        type: pagerduty:UserHandoffNotificationRule
        properties:
          userId: ${example.id}
          handoffType: both
          notifyAdvanceInMinutes: 180
          contactMethod:
            id: ${phone.id}
            type: ${phone.type}
    

    Create UserHandoffNotificationRule Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new UserHandoffNotificationRule(name: string, args: UserHandoffNotificationRuleArgs, opts?: CustomResourceOptions);
    @overload
    def UserHandoffNotificationRule(resource_name: str,
                                    args: UserHandoffNotificationRuleArgs,
                                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def UserHandoffNotificationRule(resource_name: str,
                                    opts: Optional[ResourceOptions] = None,
                                    contact_method: Optional[UserHandoffNotificationRuleContactMethodArgs] = None,
                                    notify_advance_in_minutes: Optional[int] = None,
                                    user_id: Optional[str] = None,
                                    handoff_type: Optional[str] = None)
    func NewUserHandoffNotificationRule(ctx *Context, name string, args UserHandoffNotificationRuleArgs, opts ...ResourceOption) (*UserHandoffNotificationRule, error)
    public UserHandoffNotificationRule(string name, UserHandoffNotificationRuleArgs args, CustomResourceOptions? opts = null)
    public UserHandoffNotificationRule(String name, UserHandoffNotificationRuleArgs args)
    public UserHandoffNotificationRule(String name, UserHandoffNotificationRuleArgs args, CustomResourceOptions options)
    
    type: pagerduty:UserHandoffNotificationRule
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args UserHandoffNotificationRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args UserHandoffNotificationRuleArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args UserHandoffNotificationRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserHandoffNotificationRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserHandoffNotificationRuleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var userHandoffNotificationRuleResource = new Pagerduty.UserHandoffNotificationRule("userHandoffNotificationRuleResource", new()
    {
        ContactMethod = new Pagerduty.Inputs.UserHandoffNotificationRuleContactMethodArgs
        {
            Id = "string",
            Type = "string",
        },
        NotifyAdvanceInMinutes = 0,
        UserId = "string",
        HandoffType = "string",
    });
    
    example, err := pagerduty.NewUserHandoffNotificationRule(ctx, "userHandoffNotificationRuleResource", &pagerduty.UserHandoffNotificationRuleArgs{
    	ContactMethod: &pagerduty.UserHandoffNotificationRuleContactMethodArgs{
    		Id:   pulumi.String("string"),
    		Type: pulumi.String("string"),
    	},
    	NotifyAdvanceInMinutes: pulumi.Int(0),
    	UserId:                 pulumi.String("string"),
    	HandoffType:            pulumi.String("string"),
    })
    
    var userHandoffNotificationRuleResource = new UserHandoffNotificationRule("userHandoffNotificationRuleResource", UserHandoffNotificationRuleArgs.builder()
        .contactMethod(UserHandoffNotificationRuleContactMethodArgs.builder()
            .id("string")
            .type("string")
            .build())
        .notifyAdvanceInMinutes(0)
        .userId("string")
        .handoffType("string")
        .build());
    
    user_handoff_notification_rule_resource = pagerduty.UserHandoffNotificationRule("userHandoffNotificationRuleResource",
        contact_method={
            "id": "string",
            "type": "string",
        },
        notify_advance_in_minutes=0,
        user_id="string",
        handoff_type="string")
    
    const userHandoffNotificationRuleResource = new pagerduty.UserHandoffNotificationRule("userHandoffNotificationRuleResource", {
        contactMethod: {
            id: "string",
            type: "string",
        },
        notifyAdvanceInMinutes: 0,
        userId: "string",
        handoffType: "string",
    });
    
    type: pagerduty:UserHandoffNotificationRule
    properties:
        contactMethod:
            id: string
            type: string
        handoffType: string
        notifyAdvanceInMinutes: 0
        userId: string
    

    UserHandoffNotificationRule Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The UserHandoffNotificationRule resource accepts the following input properties:

    ContactMethod UserHandoffNotificationRuleContactMethod
    The contact method to notify the user. Contact method documented below.
    NotifyAdvanceInMinutes int
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    UserId string
    The ID of the user.
    HandoffType string
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.
    ContactMethod UserHandoffNotificationRuleContactMethodArgs
    The contact method to notify the user. Contact method documented below.
    NotifyAdvanceInMinutes int
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    UserId string
    The ID of the user.
    HandoffType string
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.
    contactMethod UserHandoffNotificationRuleContactMethod
    The contact method to notify the user. Contact method documented below.
    notifyAdvanceInMinutes Integer
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    userId String
    The ID of the user.
    handoffType String
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.
    contactMethod UserHandoffNotificationRuleContactMethod
    The contact method to notify the user. Contact method documented below.
    notifyAdvanceInMinutes number
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    userId string
    The ID of the user.
    handoffType string
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.
    contact_method UserHandoffNotificationRuleContactMethodArgs
    The contact method to notify the user. Contact method documented below.
    notify_advance_in_minutes int
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    user_id str
    The ID of the user.
    handoff_type str
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.
    contactMethod Property Map
    The contact method to notify the user. Contact method documented below.
    notifyAdvanceInMinutes Number
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    userId String
    The ID of the user.
    handoffType String
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the UserHandoffNotificationRule resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing UserHandoffNotificationRule Resource

    Get an existing UserHandoffNotificationRule 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?: UserHandoffNotificationRuleState, opts?: CustomResourceOptions): UserHandoffNotificationRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            contact_method: Optional[UserHandoffNotificationRuleContactMethodArgs] = None,
            handoff_type: Optional[str] = None,
            notify_advance_in_minutes: Optional[int] = None,
            user_id: Optional[str] = None) -> UserHandoffNotificationRule
    func GetUserHandoffNotificationRule(ctx *Context, name string, id IDInput, state *UserHandoffNotificationRuleState, opts ...ResourceOption) (*UserHandoffNotificationRule, error)
    public static UserHandoffNotificationRule Get(string name, Input<string> id, UserHandoffNotificationRuleState? state, CustomResourceOptions? opts = null)
    public static UserHandoffNotificationRule get(String name, Output<String> id, UserHandoffNotificationRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    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:
    ContactMethod UserHandoffNotificationRuleContactMethod
    The contact method to notify the user. Contact method documented below.
    HandoffType string
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.
    NotifyAdvanceInMinutes int
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    UserId string
    The ID of the user.
    ContactMethod UserHandoffNotificationRuleContactMethodArgs
    The contact method to notify the user. Contact method documented below.
    HandoffType string
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.
    NotifyAdvanceInMinutes int
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    UserId string
    The ID of the user.
    contactMethod UserHandoffNotificationRuleContactMethod
    The contact method to notify the user. Contact method documented below.
    handoffType String
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.
    notifyAdvanceInMinutes Integer
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    userId String
    The ID of the user.
    contactMethod UserHandoffNotificationRuleContactMethod
    The contact method to notify the user. Contact method documented below.
    handoffType string
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.
    notifyAdvanceInMinutes number
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    userId string
    The ID of the user.
    contact_method UserHandoffNotificationRuleContactMethodArgs
    The contact method to notify the user. Contact method documented below.
    handoff_type str
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.
    notify_advance_in_minutes int
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    user_id str
    The ID of the user.
    contactMethod Property Map
    The contact method to notify the user. Contact method documented below.
    handoffType String
    The type of handoff to notify the user about. Possible values are oncall, offcall, both.
    notifyAdvanceInMinutes Number
    The number of minutes before the handoff that the user should be notified. Must be a positive integer greater than or equal to 0.
    userId String
    The ID of the user.

    Supporting Types

    UserHandoffNotificationRuleContactMethod, UserHandoffNotificationRuleContactMethodArgs

    Id string
    The ID of the contact method.
    Type string
    The type of the contact method. May be (email_contact_method, email_contact_method_reference, phone_contact_method, phone_contact_method_reference, push_notification_contact_method, push_notification_contact_method_reference, sms_contact_method, sms_contact_method_reference).
    Id string
    The ID of the contact method.
    Type string
    The type of the contact method. May be (email_contact_method, email_contact_method_reference, phone_contact_method, phone_contact_method_reference, push_notification_contact_method, push_notification_contact_method_reference, sms_contact_method, sms_contact_method_reference).
    id String
    The ID of the contact method.
    type String
    The type of the contact method. May be (email_contact_method, email_contact_method_reference, phone_contact_method, phone_contact_method_reference, push_notification_contact_method, push_notification_contact_method_reference, sms_contact_method, sms_contact_method_reference).
    id string
    The ID of the contact method.
    type string
    The type of the contact method. May be (email_contact_method, email_contact_method_reference, phone_contact_method, phone_contact_method_reference, push_notification_contact_method, push_notification_contact_method_reference, sms_contact_method, sms_contact_method_reference).
    id str
    The ID of the contact method.
    type str
    The type of the contact method. May be (email_contact_method, email_contact_method_reference, phone_contact_method, phone_contact_method_reference, push_notification_contact_method, push_notification_contact_method_reference, sms_contact_method, sms_contact_method_reference).
    id String
    The ID of the contact method.
    type String
    The type of the contact method. May be (email_contact_method, email_contact_method_reference, phone_contact_method, phone_contact_method_reference, push_notification_contact_method, push_notification_contact_method_reference, sms_contact_method, sms_contact_method_reference).

    Import

    User handoff notification rules can be imported using the user_id and id separated by a dot, e.g.

    $ pulumi import pagerduty:index/userHandoffNotificationRule:UserHandoffNotificationRule main PX4IAP4.PULREBP
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    PagerDuty pulumi/pulumi-pagerduty
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the pagerduty Terraform Provider.
    pagerduty logo
    PagerDuty v4.17.0 published on Wednesday, Nov 20, 2024 by Pulumi