1. Packages
  2. PagerDuty
  3. API Docs
  4. IncidentWorkflowTrigger
PagerDuty v4.11.4 published on Wednesday, Apr 17, 2024 by Pulumi

pagerduty.IncidentWorkflowTrigger

Explore with Pulumi AI

pagerduty logo
PagerDuty v4.11.4 published on Wednesday, Apr 17, 2024 by Pulumi

    An Incident Workflow Trigger defines when and if an Incident Workflow will be triggered.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as pagerduty from "@pulumi/pagerduty";
    
    const myFirstWorkflow = new pagerduty.IncidentWorkflow("myFirstWorkflow", {
        description: "This Incident Workflow is an example",
        steps: [{
            name: "Send Status Update",
            action: "pagerduty.com:incident-workflows:send-status-update:1",
            inputs: [{
                name: "Message",
                value: "Example status message sent on {{current_date}}",
            }],
        }],
    });
    const firstService = pagerduty.getService({
        name: "My First Service",
    });
    const automaticTrigger = new pagerduty.IncidentWorkflowTrigger("automaticTrigger", {
        type: "conditional",
        workflow: myFirstWorkflow.id,
        services: [pagerduty_service.first_service.id],
        condition: "incident.priority matches 'P1'",
        subscribedToAllServices: false,
    });
    const devops = pagerduty.getTeam({
        name: "devops",
    });
    const manualTrigger = new pagerduty.IncidentWorkflowTrigger("manualTrigger", {
        type: "manual",
        workflow: myFirstWorkflow.id,
        services: [pagerduty_service.first_service.id],
    });
    
    import pulumi
    import pulumi_pagerduty as pagerduty
    
    my_first_workflow = pagerduty.IncidentWorkflow("myFirstWorkflow",
        description="This Incident Workflow is an example",
        steps=[pagerduty.IncidentWorkflowStepArgs(
            name="Send Status Update",
            action="pagerduty.com:incident-workflows:send-status-update:1",
            inputs=[pagerduty.IncidentWorkflowStepInputArgs(
                name="Message",
                value="Example status message sent on {{current_date}}",
            )],
        )])
    first_service = pagerduty.get_service(name="My First Service")
    automatic_trigger = pagerduty.IncidentWorkflowTrigger("automaticTrigger",
        type="conditional",
        workflow=my_first_workflow.id,
        services=[pagerduty_service["first_service"]["id"]],
        condition="incident.priority matches 'P1'",
        subscribed_to_all_services=False)
    devops = pagerduty.get_team(name="devops")
    manual_trigger = pagerduty.IncidentWorkflowTrigger("manualTrigger",
        type="manual",
        workflow=my_first_workflow.id,
        services=[pagerduty_service["first_service"]["id"]])
    
    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 {
    		myFirstWorkflow, err := pagerduty.NewIncidentWorkflow(ctx, "myFirstWorkflow", &pagerduty.IncidentWorkflowArgs{
    			Description: pulumi.String("This Incident Workflow is an example"),
    			Steps: pagerduty.IncidentWorkflowStepArray{
    				&pagerduty.IncidentWorkflowStepArgs{
    					Name:   pulumi.String("Send Status Update"),
    					Action: pulumi.String("pagerduty.com:incident-workflows:send-status-update:1"),
    					Inputs: pagerduty.IncidentWorkflowStepInputTypeArray{
    						&pagerduty.IncidentWorkflowStepInputTypeArgs{
    							Name:  pulumi.String("Message"),
    							Value: pulumi.String("Example status message sent on {{current_date}}"),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.LookupService(ctx, &pagerduty.LookupServiceArgs{
    			Name: "My First Service",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewIncidentWorkflowTrigger(ctx, "automaticTrigger", &pagerduty.IncidentWorkflowTriggerArgs{
    			Type:     pulumi.String("conditional"),
    			Workflow: myFirstWorkflow.ID(),
    			Services: pulumi.StringArray{
    				pagerduty_service.First_service.Id,
    			},
    			Condition:               pulumi.String("incident.priority matches 'P1'"),
    			SubscribedToAllServices: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.LookupTeam(ctx, &pagerduty.LookupTeamArgs{
    			Name: "devops",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = pagerduty.NewIncidentWorkflowTrigger(ctx, "manualTrigger", &pagerduty.IncidentWorkflowTriggerArgs{
    			Type:     pulumi.String("manual"),
    			Workflow: myFirstWorkflow.ID(),
    			Services: pulumi.StringArray{
    				pagerduty_service.First_service.Id,
    			},
    		})
    		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 myFirstWorkflow = new Pagerduty.IncidentWorkflow("myFirstWorkflow", new()
        {
            Description = "This Incident Workflow is an example",
            Steps = new[]
            {
                new Pagerduty.Inputs.IncidentWorkflowStepArgs
                {
                    Name = "Send Status Update",
                    Action = "pagerduty.com:incident-workflows:send-status-update:1",
                    Inputs = new[]
                    {
                        new Pagerduty.Inputs.IncidentWorkflowStepInputArgs
                        {
                            Name = "Message",
                            Value = "Example status message sent on {{current_date}}",
                        },
                    },
                },
            },
        });
    
        var firstService = Pagerduty.GetService.Invoke(new()
        {
            Name = "My First Service",
        });
    
        var automaticTrigger = new Pagerduty.IncidentWorkflowTrigger("automaticTrigger", new()
        {
            Type = "conditional",
            Workflow = myFirstWorkflow.Id,
            Services = new[]
            {
                pagerduty_service.First_service.Id,
            },
            Condition = "incident.priority matches 'P1'",
            SubscribedToAllServices = false,
        });
    
        var devops = Pagerduty.GetTeam.Invoke(new()
        {
            Name = "devops",
        });
    
        var manualTrigger = new Pagerduty.IncidentWorkflowTrigger("manualTrigger", new()
        {
            Type = "manual",
            Workflow = myFirstWorkflow.Id,
            Services = new[]
            {
                pagerduty_service.First_service.Id,
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.pagerduty.IncidentWorkflow;
    import com.pulumi.pagerduty.IncidentWorkflowArgs;
    import com.pulumi.pagerduty.inputs.IncidentWorkflowStepArgs;
    import com.pulumi.pagerduty.PagerdutyFunctions;
    import com.pulumi.pagerduty.inputs.GetServiceArgs;
    import com.pulumi.pagerduty.IncidentWorkflowTrigger;
    import com.pulumi.pagerduty.IncidentWorkflowTriggerArgs;
    import com.pulumi.pagerduty.inputs.GetTeamArgs;
    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 myFirstWorkflow = new IncidentWorkflow("myFirstWorkflow", IncidentWorkflowArgs.builder()        
                .description("This Incident Workflow is an example")
                .steps(IncidentWorkflowStepArgs.builder()
                    .name("Send Status Update")
                    .action("pagerduty.com:incident-workflows:send-status-update:1")
                    .inputs(IncidentWorkflowStepInputArgs.builder()
                        .name("Message")
                        .value("Example status message sent on {{current_date}}")
                        .build())
                    .build())
                .build());
    
            final var firstService = PagerdutyFunctions.getService(GetServiceArgs.builder()
                .name("My First Service")
                .build());
    
            var automaticTrigger = new IncidentWorkflowTrigger("automaticTrigger", IncidentWorkflowTriggerArgs.builder()        
                .type("conditional")
                .workflow(myFirstWorkflow.id())
                .services(pagerduty_service.first_service().id())
                .condition("incident.priority matches 'P1'")
                .subscribedToAllServices(false)
                .build());
    
            final var devops = PagerdutyFunctions.getTeam(GetTeamArgs.builder()
                .name("devops")
                .build());
    
            var manualTrigger = new IncidentWorkflowTrigger("manualTrigger", IncidentWorkflowTriggerArgs.builder()        
                .type("manual")
                .workflow(myFirstWorkflow.id())
                .services(pagerduty_service.first_service().id())
                .build());
    
        }
    }
    
    resources:
      myFirstWorkflow:
        type: pagerduty:IncidentWorkflow
        properties:
          description: This Incident Workflow is an example
          steps:
            - name: Send Status Update
              action: pagerduty.com:incident-workflows:send-status-update:1
              inputs:
                - name: Message
                  value: Example status message sent on {{current_date}}
      automaticTrigger:
        type: pagerduty:IncidentWorkflowTrigger
        properties:
          type: conditional
          workflow: ${myFirstWorkflow.id}
          services:
            - ${pagerduty_service.first_service.id}
          condition: incident.priority matches 'P1'
          subscribedToAllServices: false
      manualTrigger:
        type: pagerduty:IncidentWorkflowTrigger
        properties:
          type: manual
          workflow: ${myFirstWorkflow.id}
          services:
            - ${pagerduty_service.first_service.id}
    variables:
      firstService:
        fn::invoke:
          Function: pagerduty:getService
          Arguments:
            name: My First Service
      devops:
        fn::invoke:
          Function: pagerduty:getTeam
          Arguments:
            name: devops
    

    Create IncidentWorkflowTrigger Resource

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

    Constructor syntax

    new IncidentWorkflowTrigger(name: string, args: IncidentWorkflowTriggerArgs, opts?: CustomResourceOptions);
    @overload
    def IncidentWorkflowTrigger(resource_name: str,
                                args: IncidentWorkflowTriggerArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def IncidentWorkflowTrigger(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                subscribed_to_all_services: Optional[bool] = None,
                                type: Optional[str] = None,
                                workflow: Optional[str] = None,
                                condition: Optional[str] = None,
                                services: Optional[Sequence[str]] = None)
    func NewIncidentWorkflowTrigger(ctx *Context, name string, args IncidentWorkflowTriggerArgs, opts ...ResourceOption) (*IncidentWorkflowTrigger, error)
    public IncidentWorkflowTrigger(string name, IncidentWorkflowTriggerArgs args, CustomResourceOptions? opts = null)
    public IncidentWorkflowTrigger(String name, IncidentWorkflowTriggerArgs args)
    public IncidentWorkflowTrigger(String name, IncidentWorkflowTriggerArgs args, CustomResourceOptions options)
    
    type: pagerduty:IncidentWorkflowTrigger
    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 IncidentWorkflowTriggerArgs
    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 IncidentWorkflowTriggerArgs
    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 IncidentWorkflowTriggerArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IncidentWorkflowTriggerArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IncidentWorkflowTriggerArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

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

    var incidentWorkflowTriggerResource = new Pagerduty.IncidentWorkflowTrigger("incidentWorkflowTriggerResource", new()
    {
        SubscribedToAllServices = false,
        Type = "string",
        Workflow = "string",
        Condition = "string",
        Services = new[]
        {
            "string",
        },
    });
    
    example, err := pagerduty.NewIncidentWorkflowTrigger(ctx, "incidentWorkflowTriggerResource", &pagerduty.IncidentWorkflowTriggerArgs{
    	SubscribedToAllServices: pulumi.Bool(false),
    	Type:                    pulumi.String("string"),
    	Workflow:                pulumi.String("string"),
    	Condition:               pulumi.String("string"),
    	Services: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var incidentWorkflowTriggerResource = new IncidentWorkflowTrigger("incidentWorkflowTriggerResource", IncidentWorkflowTriggerArgs.builder()        
        .subscribedToAllServices(false)
        .type("string")
        .workflow("string")
        .condition("string")
        .services("string")
        .build());
    
    incident_workflow_trigger_resource = pagerduty.IncidentWorkflowTrigger("incidentWorkflowTriggerResource",
        subscribed_to_all_services=False,
        type="string",
        workflow="string",
        condition="string",
        services=["string"])
    
    const incidentWorkflowTriggerResource = new pagerduty.IncidentWorkflowTrigger("incidentWorkflowTriggerResource", {
        subscribedToAllServices: false,
        type: "string",
        workflow: "string",
        condition: "string",
        services: ["string"],
    });
    
    type: pagerduty:IncidentWorkflowTrigger
    properties:
        condition: string
        services:
            - string
        subscribedToAllServices: false
        type: string
        workflow: string
    

    IncidentWorkflowTrigger Resource Properties

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

    Inputs

    The IncidentWorkflowTrigger resource accepts the following input properties:

    SubscribedToAllServices bool
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    Type string
    [Updating causes resource replacement] May be either manual or conditional.
    Workflow string
    The workflow ID for the workflow to trigger.
    Condition string
    A PCL condition string which must be satisfied for the trigger to fire.
    Services List<string>
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.
    SubscribedToAllServices bool
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    Type string
    [Updating causes resource replacement] May be either manual or conditional.
    Workflow string
    The workflow ID for the workflow to trigger.
    Condition string
    A PCL condition string which must be satisfied for the trigger to fire.
    Services []string
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.
    subscribedToAllServices Boolean
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    type String
    [Updating causes resource replacement] May be either manual or conditional.
    workflow String
    The workflow ID for the workflow to trigger.
    condition String
    A PCL condition string which must be satisfied for the trigger to fire.
    services List<String>
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.
    subscribedToAllServices boolean
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    type string
    [Updating causes resource replacement] May be either manual or conditional.
    workflow string
    The workflow ID for the workflow to trigger.
    condition string
    A PCL condition string which must be satisfied for the trigger to fire.
    services string[]
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.
    subscribed_to_all_services bool
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    type str
    [Updating causes resource replacement] May be either manual or conditional.
    workflow str
    The workflow ID for the workflow to trigger.
    condition str
    A PCL condition string which must be satisfied for the trigger to fire.
    services Sequence[str]
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.
    subscribedToAllServices Boolean
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    type String
    [Updating causes resource replacement] May be either manual or conditional.
    workflow String
    The workflow ID for the workflow to trigger.
    condition String
    A PCL condition string which must be satisfied for the trigger to fire.
    services List<String>
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the IncidentWorkflowTrigger 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 IncidentWorkflowTrigger Resource

    Get an existing IncidentWorkflowTrigger 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?: IncidentWorkflowTriggerState, opts?: CustomResourceOptions): IncidentWorkflowTrigger
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            condition: Optional[str] = None,
            services: Optional[Sequence[str]] = None,
            subscribed_to_all_services: Optional[bool] = None,
            type: Optional[str] = None,
            workflow: Optional[str] = None) -> IncidentWorkflowTrigger
    func GetIncidentWorkflowTrigger(ctx *Context, name string, id IDInput, state *IncidentWorkflowTriggerState, opts ...ResourceOption) (*IncidentWorkflowTrigger, error)
    public static IncidentWorkflowTrigger Get(string name, Input<string> id, IncidentWorkflowTriggerState? state, CustomResourceOptions? opts = null)
    public static IncidentWorkflowTrigger get(String name, Output<String> id, IncidentWorkflowTriggerState 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:
    Condition string
    A PCL condition string which must be satisfied for the trigger to fire.
    Services List<string>
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.
    SubscribedToAllServices bool
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    Type string
    [Updating causes resource replacement] May be either manual or conditional.
    Workflow string
    The workflow ID for the workflow to trigger.
    Condition string
    A PCL condition string which must be satisfied for the trigger to fire.
    Services []string
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.
    SubscribedToAllServices bool
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    Type string
    [Updating causes resource replacement] May be either manual or conditional.
    Workflow string
    The workflow ID for the workflow to trigger.
    condition String
    A PCL condition string which must be satisfied for the trigger to fire.
    services List<String>
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.
    subscribedToAllServices Boolean
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    type String
    [Updating causes resource replacement] May be either manual or conditional.
    workflow String
    The workflow ID for the workflow to trigger.
    condition string
    A PCL condition string which must be satisfied for the trigger to fire.
    services string[]
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.
    subscribedToAllServices boolean
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    type string
    [Updating causes resource replacement] May be either manual or conditional.
    workflow string
    The workflow ID for the workflow to trigger.
    condition str
    A PCL condition string which must be satisfied for the trigger to fire.
    services Sequence[str]
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.
    subscribed_to_all_services bool
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    type str
    [Updating causes resource replacement] May be either manual or conditional.
    workflow str
    The workflow ID for the workflow to trigger.
    condition String
    A PCL condition string which must be satisfied for the trigger to fire.
    services List<String>
    A list of service IDs. Incidents in any of the listed services are eligible to fire this trigger.
    subscribedToAllServices Boolean
    Set to true if the trigger should be eligible for firing on all services. Only allowed to be true if the services list is not defined or empty.
    type String
    [Updating causes resource replacement] May be either manual or conditional.
    workflow String
    The workflow ID for the workflow to trigger.

    Import

    Incident workflows can be imported using the id, e.g.

    $ pulumi import pagerduty:index/incidentWorkflowTrigger:IncidentWorkflowTrigger pagerduty_incident_workflow_trigger PLBP09X
    

    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.11.4 published on Wednesday, Apr 17, 2024 by Pulumi