1. Registry
  2. Packages
  3. Incident Provider
  4. API Docs
  5. getIncidentRole
Viewing docs for incident 7.0.0
published on Friday, Sep 11, 2026 by incident-io
Viewing docs for incident 7.0.0
published on Friday, Sep 11, 2026 by incident-io

    This data source provides information about an incident role, looked up either by id or by name.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as incident from "@pulumi/incident";
    
    // Create a communications lead that is not required.
    const commsIncidentRole = new incident.IncidentRole("comms", {
        name: "Communications Lead",
        description: "Responsible for communications on behalf of the response team.",
        instructions: "Manage internal and external communications on behalf of the response team.",
        shortform: "comms",
    });
    // Reference the incident role by its ID.
    const comms = incident.getIncidentRoleOutput({
        id: commsIncidentRole.id,
    });
    // Or look one up by name, which avoids pinning an ID that differs between
    // workspaces. This is how you get hold of the roles incident.io creates for you,
    // such as Incident Lead.
    const incidentLead = incident.getIncidentRole({
        name: "Incident Lead",
    });
    
    import pulumi
    import pulumi_incident as incident
    
    # Create a communications lead that is not required.
    comms_incident_role = incident.IncidentRole("comms",
        name="Communications Lead",
        description="Responsible for communications on behalf of the response team.",
        instructions="Manage internal and external communications on behalf of the response team.",
        shortform="comms")
    # Reference the incident role by its ID.
    comms = incident.get_incident_role_output(id=comms_incident_role.id)
    # Or look one up by name, which avoids pinning an ID that differs between
    # workspaces. This is how you get hold of the roles incident.io creates for you,
    # such as Incident Lead.
    incident_lead = incident.get_incident_role(name="Incident Lead")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/incident/v7/incident"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a communications lead that is not required.
    		commsIncidentRole, err := incident.NewIncidentRole(ctx, "comms", &incident.IncidentRoleArgs{
    			Name:         pulumi.String("Communications Lead"),
    			Description:  pulumi.String("Responsible for communications on behalf of the response team."),
    			Instructions: pulumi.String("Manage internal and external communications on behalf of the response team."),
    			Shortform:    pulumi.String("comms"),
    		})
    		if err != nil {
    			return err
    		}
    		// Reference the incident role by its ID.
    		_ = incident.LookupIncidentRoleOutput(ctx, incident.GetIncidentRoleOutputArgs{
    			Id: commsIncidentRole.ID(),
    		}, nil)
    		// Or look one up by name, which avoids pinning an ID that differs between
    		// workspaces. This is how you get hold of the roles incident.io creates for you,
    		// such as Incident Lead.
    		_, err = incident.LookupIncidentRole(ctx, &incident.LookupIncidentRoleArgs{
    			Name: pulumi.StringRef("Incident Lead"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Incident = Pulumi.Incident;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a communications lead that is not required.
        var commsIncidentRole = new Incident.IncidentRole("comms", new()
        {
            Name = "Communications Lead",
            Description = "Responsible for communications on behalf of the response team.",
            Instructions = "Manage internal and external communications on behalf of the response team.",
            Shortform = "comms",
        });
    
        // Reference the incident role by its ID.
        var comms = Incident.GetIncidentRole.Invoke(new()
        {
            Id = commsIncidentRole.Id,
        });
    
        // Or look one up by name, which avoids pinning an ID that differs between
        // workspaces. This is how you get hold of the roles incident.io creates for you,
        // such as Incident Lead.
        var incidentLead = Incident.GetIncidentRole.Invoke(new()
        {
            Name = "Incident Lead",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.incident.IncidentRole;
    import com.pulumi.incident.IncidentRoleArgs;
    import com.pulumi.incident.IncidentFunctions;
    import com.pulumi.incident.inputs.GetIncidentRoleArgs;
    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) {
            // Create a communications lead that is not required.
            var commsIncidentRole = new IncidentRole("commsIncidentRole", IncidentRoleArgs.builder()
                .name("Communications Lead")
                .description("Responsible for communications on behalf of the response team.")
                .instructions("Manage internal and external communications on behalf of the response team.")
                .shortform("comms")
                .build());
    
            // Reference the incident role by its ID.
            final var comms = IncidentFunctions.getIncidentRole(GetIncidentRoleArgs.builder()
                .id(commsIncidentRole.id())
                .build());
    
            // Or look one up by name, which avoids pinning an ID that differs between
            // workspaces. This is how you get hold of the roles incident.io creates for you,
            // such as Incident Lead.
            final var incidentLead = IncidentFunctions.getIncidentRole(GetIncidentRoleArgs.builder()
                .name("Incident Lead")
                .build());
    
        }
    }
    
    resources:
      # Create a communications lead that is not required.
      commsIncidentRole:
        type: incident:IncidentRole
        name: comms
        properties:
          name: Communications Lead
          description: Responsible for communications on behalf of the response team.
          instructions: Manage internal and external communications on behalf of the response team.
          shortform: comms
    variables:
      # Reference the incident role by its ID.
      comms:
        fn::invoke:
          function: incident:getIncidentRole
          arguments:
            id: ${commsIncidentRole.id}
      # Or look one up by name, which avoids pinning an ID that differs between
      # workspaces. This is how you get hold of the roles incident.io creates for you,
      # such as Incident Lead.
      incidentLead:
        fn::invoke:
          function: incident:getIncidentRole
          arguments:
            name: Incident Lead
    
    Example coming soon!
    

    Using getIncidentRole

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getIncidentRole(args: GetIncidentRoleArgs, opts?: InvokeOptions): Promise<GetIncidentRoleResult>
    function getIncidentRoleOutput(args: GetIncidentRoleOutputArgs, opts?: InvokeOutputOptions): Output<GetIncidentRoleResult>
    def get_incident_role(id: Optional[str] = None,
                          name: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetIncidentRoleResult
    def get_incident_role_output(id: pulumi.Input[Optional[str]] = None,
                          name: pulumi.Input[Optional[str]] = None,
                          opts: Optional[InvokeOutputOptions] = None) -> Output[GetIncidentRoleResult]
    func LookupIncidentRole(ctx *Context, args *LookupIncidentRoleArgs, opts ...InvokeOption) (*LookupIncidentRoleResult, error)
    func LookupIncidentRoleOutput(ctx *Context, args *LookupIncidentRoleOutputArgs, opts ...InvokeOption) LookupIncidentRoleResultOutput

    > Note: This function is named LookupIncidentRole in the Go SDK.

    public static class GetIncidentRole 
    {
        public static Task<GetIncidentRoleResult> InvokeAsync(GetIncidentRoleArgs args, InvokeOptions? opts = null)
        public static Output<GetIncidentRoleResult> Invoke(GetIncidentRoleInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetIncidentRoleResult> Invoke(GetIncidentRoleInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetIncidentRoleResult> getIncidentRole(GetIncidentRoleArgs args, InvokeOptions options)
    public static Output<GetIncidentRoleResult> getIncidentRole(GetIncidentRoleArgs args, InvokeOptions options)
    public static Output<GetIncidentRoleResult> getIncidentRole(GetIncidentRoleArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: incident:index/getIncidentRole:getIncidentRole
      arguments:
        # arguments dictionary
    data "incident_get_incident_role" "name" {
        # arguments
    }

    The following arguments are supported:

    Id string
    Unique identifier for the role
    Name string
    Human readable name of the incident role
    Id string
    Unique identifier for the role
    Name string
    Human readable name of the incident role
    id string
    Unique identifier for the role
    name string
    Human readable name of the incident role
    id String
    Unique identifier for the role
    name String
    Human readable name of the incident role
    id string
    Unique identifier for the role
    name string
    Human readable name of the incident role
    id str
    Unique identifier for the role
    name str
    Human readable name of the incident role
    id String
    Unique identifier for the role
    name String
    Human readable name of the incident role

    getIncidentRole Result

    The following output properties are available:

    Description string
    Describes the purpose of the role
    Id string
    Unique identifier for the role
    Instructions string
    Provided to whoever is nominated for the role. Note that this will be empty for the 'reporter' role.
    Name string
    Human readable name of the incident role
    Shortform string
    Short human readable name for Slack. Note that this will be empty for the 'reporter' role.
    Description string
    Describes the purpose of the role
    Id string
    Unique identifier for the role
    Instructions string
    Provided to whoever is nominated for the role. Note that this will be empty for the 'reporter' role.
    Name string
    Human readable name of the incident role
    Shortform string
    Short human readable name for Slack. Note that this will be empty for the 'reporter' role.
    description string
    Describes the purpose of the role
    id string
    Unique identifier for the role
    instructions string
    Provided to whoever is nominated for the role. Note that this will be empty for the 'reporter' role.
    name string
    Human readable name of the incident role
    shortform string
    Short human readable name for Slack. Note that this will be empty for the 'reporter' role.
    description String
    Describes the purpose of the role
    id String
    Unique identifier for the role
    instructions String
    Provided to whoever is nominated for the role. Note that this will be empty for the 'reporter' role.
    name String
    Human readable name of the incident role
    shortform String
    Short human readable name for Slack. Note that this will be empty for the 'reporter' role.
    description string
    Describes the purpose of the role
    id string
    Unique identifier for the role
    instructions string
    Provided to whoever is nominated for the role. Note that this will be empty for the 'reporter' role.
    name string
    Human readable name of the incident role
    shortform string
    Short human readable name for Slack. Note that this will be empty for the 'reporter' role.
    description str
    Describes the purpose of the role
    id str
    Unique identifier for the role
    instructions str
    Provided to whoever is nominated for the role. Note that this will be empty for the 'reporter' role.
    name str
    Human readable name of the incident role
    shortform str
    Short human readable name for Slack. Note that this will be empty for the 'reporter' role.
    description String
    Describes the purpose of the role
    id String
    Unique identifier for the role
    instructions String
    Provided to whoever is nominated for the role. Note that this will be empty for the 'reporter' role.
    name String
    Human readable name of the incident role
    shortform String
    Short human readable name for Slack. Note that this will be empty for the 'reporter' role.

    Package Details

    Repository
    incident incident-io/terraform-provider-incident
    License
    Notes
    This Pulumi package is based on the incident Terraform Provider.
    Viewing docs for incident 7.0.0
    published on Friday, Sep 11, 2026 by incident-io

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial