1. Registry
  2. Packages
  3. Grafana Cloud
  4. API Docs
  5. incident
  6. Role
Viewing docs for Grafana v2.45.0
published on Monday, Nov 9, 2026 by pulumiverse
grafana logo Grafana
Viewing docs for Grafana v2.45.0
published on Monday, Nov 9, 2026 by pulumiverse

    Manages a Grafana Incident role that can be assigned to people during an incident.

    The Incident API enforces two limits that affect Terraform:

    • Creating or unarchiving a role fails when the organization already has 5 active (non-archived) roles.
    • Deleting or archiving a role fails when the organization has 2 or fewer active roles.

    Terraform applies independent resources in parallel, so a configuration that frees an active slot and fills it in the same apply may fail depending on which call reaches the API first. Order the two with dependsOn, putting the dependency on whichever role frees the slot:

    • At the 5-active limit, the role being created or unarchived depends on the role being archived or deleted.

    • At the 2-active limit, the role being archived or deleted depends on the role being created or unarchived.

    • Official documentation

    • API documentation

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumiverse/grafana";
    
    const commander = new grafana.incident.Role("commander", {
        name: "Commander",
        description: "Coordinates the response and owns the incident.",
        important: true,
        mandatory: true,
    });
    
    import pulumi
    import pulumiverse_grafana as grafana
    
    commander = grafana.incident.Role("commander",
        name="Commander",
        description="Coordinates the response and owns the incident.",
        important=True,
        mandatory=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-grafana/sdk/v2/go/grafana/incident"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := incident.NewRole(ctx, "commander", &incident.RoleArgs{
    			Name:        pulumi.String("Commander"),
    			Description: pulumi.String("Coordinates the response and owns the incident."),
    			Important:   pulumi.Bool(true),
    			Mandatory:   pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Grafana = Pulumiverse.Grafana;
    
    return await Deployment.RunAsync(() => 
    {
        var commander = new Grafana.Incident.Role("commander", new()
        {
            Name = "Commander",
            Description = "Coordinates the response and owns the incident.",
            Important = true,
            Mandatory = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.grafana.incident.Role;
    import com.pulumi.grafana.incident.RoleArgs;
    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 commander = new Role("commander", RoleArgs.builder()
                .name("Commander")
                .description("Coordinates the response and owns the incident.")
                .important(true)
                .mandatory(true)
                .build());
    
        }
    }
    
    resources:
      commander:
        type: grafana:incident:Role
        properties:
          name: Commander
          description: Coordinates the response and owns the incident.
          important: true
          mandatory: true
    
    Example coming soon!
    

    Create Role Resource

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

    Constructor syntax

    new Role(name: string, args?: RoleArgs, opts?: CustomResourceOptions);
    @overload
    def Role(resource_name: str,
             args: Optional[RoleArgs] = None,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Role(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             archived: Optional[bool] = None,
             description: Optional[str] = None,
             important: Optional[bool] = None,
             mandatory: Optional[bool] = None,
             name: Optional[str] = None)
    func NewRole(ctx *Context, name string, args *RoleArgs, opts ...ResourceOption) (*Role, error)
    public Role(string name, RoleArgs? args = null, CustomResourceOptions? opts = null)
    public Role(String name, RoleArgs args)
    public Role(String name, RoleArgs args, CustomResourceOptions options)
    
    type: grafana:incident:Role
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "grafana_incident_role" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args RoleArgs
    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 RoleArgs
    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 RoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args RoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args RoleArgs
    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 grafanaRoleResource = new Grafana.Incident.Role("grafanaRoleResource", new()
    {
        Archived = false,
        Description = "string",
        Important = false,
        Mandatory = false,
        Name = "string",
    });
    
    example, err := incident.NewRole(ctx, "grafanaRoleResource", &incident.RoleArgs{
    	Archived:    pulumi.Bool(false),
    	Description: pulumi.String("string"),
    	Important:   pulumi.Bool(false),
    	Mandatory:   pulumi.Bool(false),
    	Name:        pulumi.String("string"),
    })
    
    resource "grafana_incident_role" "grafanaRoleResource" {
      lifecycle {
        create_before_destroy = true
      }
      archived    = false
      description = "string"
      important   = false
      mandatory   = false
      name        = "string"
    }
    
    var grafanaRoleResource = new com.pulumi.grafana.incident.Role("grafanaRoleResource", com.pulumi.grafana.incident.RoleArgs.builder()
        .archived(false)
        .description("string")
        .important(false)
        .mandatory(false)
        .name("string")
        .build());
    
    grafana_role_resource = grafana.incident.Role("grafanaRoleResource",
        archived=False,
        description="string",
        important=False,
        mandatory=False,
        name="string")
    
    const grafanaRoleResource = new grafana.incident.Role("grafanaRoleResource", {
        archived: false,
        description: "string",
        important: false,
        mandatory: false,
        name: "string",
    });
    
    type: grafana:incident:Role
    properties:
        archived: false
        description: string
        important: false
        mandatory: false
        name: string
    

    Role 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 Role resource accepts the following input properties:

    Archived bool
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    Description string
    A description of what the role is responsible for.
    Important bool
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    Mandatory bool
    Whether this role must be assigned on every incident. Defaults to false.
    Name string
    The name of the role, for example Commander.
    Archived bool
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    Description string
    A description of what the role is responsible for.
    Important bool
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    Mandatory bool
    Whether this role must be assigned on every incident. Defaults to false.
    Name string
    The name of the role, for example Commander.
    archived bool
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    description string
    A description of what the role is responsible for.
    important bool
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    mandatory bool
    Whether this role must be assigned on every incident. Defaults to false.
    name string
    The name of the role, for example Commander.
    archived Boolean
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    description String
    A description of what the role is responsible for.
    important Boolean
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    mandatory Boolean
    Whether this role must be assigned on every incident. Defaults to false.
    name String
    The name of the role, for example Commander.
    archived boolean
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    description string
    A description of what the role is responsible for.
    important boolean
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    mandatory boolean
    Whether this role must be assigned on every incident. Defaults to false.
    name string
    The name of the role, for example Commander.
    archived bool
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    description str
    A description of what the role is responsible for.
    important bool
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    mandatory bool
    Whether this role must be assigned on every incident. Defaults to false.
    name str
    The name of the role, for example Commander.
    archived Boolean
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    description String
    A description of what the role is responsible for.
    important Boolean
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    mandatory Boolean
    Whether this role must be assigned on every incident. Defaults to false.
    name String
    The name of the role, for example Commander.

    Outputs

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

    Get an existing Role 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?: RoleState, opts?: CustomResourceOptions): Role
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            archived: Optional[bool] = None,
            description: Optional[str] = None,
            important: Optional[bool] = None,
            mandatory: Optional[bool] = None,
            name: Optional[str] = None) -> Role
    func GetRole(ctx *Context, name string, id IDInput, state *RoleState, opts ...ResourceOption) (*Role, error)
    public static Role Get(string name, Input<string> id, RoleState? state, CustomResourceOptions? opts = null)
    public static Role get(String name, Output<String> id, RoleState state, CustomResourceOptions options)
    resources:  _:    type: grafana:incident:Role    get:      id: ${id}
    import {
      to = grafana_incident_role.example
      id = "${id}"
    }
    
    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:
    Archived bool
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    Description string
    A description of what the role is responsible for.
    Important bool
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    Mandatory bool
    Whether this role must be assigned on every incident. Defaults to false.
    Name string
    The name of the role, for example Commander.
    Archived bool
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    Description string
    A description of what the role is responsible for.
    Important bool
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    Mandatory bool
    Whether this role must be assigned on every incident. Defaults to false.
    Name string
    The name of the role, for example Commander.
    archived bool
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    description string
    A description of what the role is responsible for.
    important bool
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    mandatory bool
    Whether this role must be assigned on every incident. Defaults to false.
    name string
    The name of the role, for example Commander.
    archived Boolean
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    description String
    A description of what the role is responsible for.
    important Boolean
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    mandatory Boolean
    Whether this role must be assigned on every incident. Defaults to false.
    name String
    The name of the role, for example Commander.
    archived boolean
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    description string
    A description of what the role is responsible for.
    important boolean
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    mandatory boolean
    Whether this role must be assigned on every incident. Defaults to false.
    name string
    The name of the role, for example Commander.
    archived bool
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    description str
    A description of what the role is responsible for.
    important bool
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    mandatory bool
    Whether this role must be assigned on every incident. Defaults to false.
    name str
    The name of the role, for example Commander.
    archived Boolean
    Whether the role is archived. Archived roles cannot be assigned on new incidents, but remain on historical ones. Defaults to false.
    description String
    A description of what the role is responsible for.
    important Boolean
    Whether assigning this role is recorded as an important activity on the incident. Defaults to false.
    mandatory Boolean
    Whether this role must be assigned on every incident. Defaults to false.
    name String
    The name of the role, for example Commander.

    Import

    terraform import grafana_incident_role.name "{{ id }}"
    

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

    Package Details

    Repository
    grafana pulumiverse/pulumi-grafana
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the grafana Terraform Provider.
    grafana logo Grafana
    Viewing docs for Grafana v2.45.0
    published on Monday, Nov 9, 2026 by pulumiverse

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial