1. Registry
  2. Packages
  3. incident.io
  4. API Docs
  5. AlertAttribute
Viewing docs for incident.io v0.4.1
published on Wednesday, Oct 21, 2026 by incident-io
incident logo incident.io
Viewing docs for incident.io v0.4.1
published on Wednesday, Oct 21, 2026 by incident-io

    View and manage alert attributes.

    Alert attributes are used to parse structured data from alerts coming in via alert sources.

    An attribute is account-wide; what fills it in is per source

    An alert attribute is the column, not the rule that populates it. It belongs to your whole incident.io organization: its name has to be unique across the account, and every alert source draws on the same set of attributes. That is deliberate — one attribute means the same thing whichever source fired the alert, so an alert route spanning several sources can match on it.

    What varies per source is the binding: the rule parsing a value for this attribute out of an incoming event. A source binds a given attribute at most once, and two sources can fill the same attribute from completely different parts of their payloads. Write each binding as an incident.AlertSourceAttribute resource, naming the attribute and the incident.AlertSource that fills it in.

    So a GCP service attribute is declared once, then bound separately by each source that sets it.

    Declaring one attribute from several workspaces

    If your Terraform is split across workspaces — one per environment, say — only one of them should declare an attribute as a resource. The others should read it with the incident.AlertAttribute data source, which looks an attribute up by name:

    import * as pulumi from "@pulumi/pulumi";
    import * as incident from "@incident-io/pulumi";
    
    const gcpService = incident.getAlertAttribute({
        name: "GCP service",
    });
    
    import pulumi
    import pulumi_incident as incident
    
    gcp_service = incident.get_alert_attribute(name="GCP service")
    
    package main
    
    import (
    	"github.com/incident-io/pulumi-incident/sdk/go/incident"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := incident.GetAlertAttribute(ctx, &incident.LookupAlertAttributeArgs{
    			Name: "GCP service",
    		}, 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(() => 
    {
        var gcpService = Incident.GetAlertAttribute.Invoke(new()
        {
            Name = "GCP service",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.incident.IncidentFunctions;
    import com.pulumi.incident.inputs.GetAlertAttributeArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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) {
            final var gcpService = IncidentFunctions.getAlertAttribute(GetAlertAttributeArgs.builder()
                .name("GCP service")
                .build());
    
        }
    }
    
    variables:
      gcpService:
        fn::invoke:
          function: incident:getAlertAttribute
          arguments:
            name: GCP service
    
    pulumi {
      required_providers {
        incident = {
          source = "pulumi/incident"
        }
      }
    }
    
    data "incident_getalertattribute" "gcpService" {
      name = "GCP service"
    }
    

    Declaring the same name in two workspaces plans cleanly in both, then fails when the second applies: the attribute it means to create already exists. To bring an attribute that already exists under a workspace’s management instead, import it.

    Per-environment differences belong on the binding rather than the attribute, so both environments share one attribute and each parses it from its own source.

    Reserved names

    Title, Description and Priority collide with properties every alert already has, and are rejected regardless of casing. Priority does exist as an attribute you can bind and filter on, but it is read-only through the API: read it with the data source rather than declaring it.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as incident from "@incident-io/pulumi";
    
    // Create an alert attribute that points at a single Github user in the catalog.
    //
    // Take the engine type from the catalog type itself rather than writing it out: a type one
    // of our integrations owns is referenced by its registry name, and a type you manage by its
    // ID, so the two don't have the same shape.
    const githubUser = incident.getCatalogType({
        typeName: "GithubUser",
    });
    const githubUserAlertAttribute = new incident.AlertAttribute("github_user", {
        name: "Github user",
        type: githubUser.then(githubUser => githubUser.attributeType),
        array: false,
        required: true,
    });
    // Create an optional alert attribute for severity information
    const severity = new incident.AlertAttribute("severity", {
        name: "Severity",
        type: "String",
        array: false,
        required: false,
        emoji: "warning",
    });
    // An attribute is account-wide, so declare it once. What differs between environments is the
    // binding that fills it in, which belongs to an alert source.
    const gcpService = new incident.AlertAttribute("gcp_service", {
        name: "GCP service",
        type: "String",
        array: false,
    });
    // Staging and production each parse the same attribute out of their own source, so both
    // environments' alerts are labelled with one attribute that routes can match on.
    const gcpServiceStaging = new incident.AlertSourceAttribute("gcp_service_staging", {
        expression: {
            operations: [{
                parse: {
                    "function": "$.resource.labels.service_name",
                    as: "String",
                },
            }],
            startFrom: "payload",
        },
        alertSourceId: gcpStaging.id,
        alertAttributeId: gcpService.id,
    });
    const gcpServiceProduction = new incident.AlertSourceAttribute("gcp_service_production", {
        expression: {
            operations: [{
                parse: {
                    "function": "$.resource.labels.service_name",
                    as: "String",
                },
            }],
            startFrom: "payload",
        },
        alertSourceId: gcpProduction.id,
        alertAttributeId: gcpService.id,
    });
    // Where a source lives in a different workspace to the attribute it binds, read the attribute
    // by name rather than declaring it again. Two workspaces declaring the same name will both plan
    // cleanly, and then the second one to apply will fail.
    const existingGcpService = incident.getAlertAttribute({
        name: "GCP service",
    });
    const gcpServiceOtherWorkspace = new incident.AlertSourceAttribute("gcp_service_other_workspace", {
        expression: {
            operations: [{
                parse: {
                    "function": "$.resource.labels.service_name",
                    as: "String",
                },
            }],
            startFrom: "payload",
        },
        alertSourceId: gcpOther.id,
        alertAttributeId: existingGcpService.then(existingGcpService => existingGcpService.id),
    });
    
    import pulumi
    import pulumi_incident as incident
    
    # Create an alert attribute that points at a single Github user in the catalog.
    #
    # Take the engine type from the catalog type itself rather than writing it out: a type one
    # of our integrations owns is referenced by its registry name, and a type you manage by its
    # ID, so the two don't have the same shape.
    github_user = incident.get_catalog_type(type_name="GithubUser")
    github_user_alert_attribute = incident.AlertAttribute("github_user",
        name="Github user",
        type=github_user.attribute_type,
        array=False,
        required=True)
    # Create an optional alert attribute for severity information
    severity = incident.AlertAttribute("severity",
        name="Severity",
        type="String",
        array=False,
        required=False,
        emoji="warning")
    # An attribute is account-wide, so declare it once. What differs between environments is the
    # binding that fills it in, which belongs to an alert source.
    gcp_service = incident.AlertAttribute("gcp_service",
        name="GCP service",
        type="String",
        array=False)
    # Staging and production each parse the same attribute out of their own source, so both
    # environments' alerts are labelled with one attribute that routes can match on.
    gcp_service_staging = incident.AlertSourceAttribute("gcp_service_staging",
        expression={
            "operations": [{
                "parse": {
                    "function": "$.resource.labels.service_name",
                    "as_": "String",
                },
            }],
            "start_from": "payload",
        },
        alert_source_id=gcp_staging["id"],
        alert_attribute_id=gcp_service.id)
    gcp_service_production = incident.AlertSourceAttribute("gcp_service_production",
        expression={
            "operations": [{
                "parse": {
                    "function": "$.resource.labels.service_name",
                    "as_": "String",
                },
            }],
            "start_from": "payload",
        },
        alert_source_id=gcp_production["id"],
        alert_attribute_id=gcp_service.id)
    # Where a source lives in a different workspace to the attribute it binds, read the attribute
    # by name rather than declaring it again. Two workspaces declaring the same name will both plan
    # cleanly, and then the second one to apply will fail.
    existing_gcp_service = incident.get_alert_attribute(name="GCP service")
    gcp_service_other_workspace = incident.AlertSourceAttribute("gcp_service_other_workspace",
        expression={
            "operations": [{
                "parse": {
                    "function": "$.resource.labels.service_name",
                    "as_": "String",
                },
            }],
            "start_from": "payload",
        },
        alert_source_id=gcp_other["id"],
        alert_attribute_id=existing_gcp_service.id)
    
    package main
    
    import (
    	"github.com/incident-io/pulumi-incident/sdk/go/incident"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create an alert attribute that points at a single Github user in the catalog.
    		//
    		// Take the engine type from the catalog type itself rather than writing it out: a type one
    		// of our integrations owns is referenced by its registry name, and a type you manage by its
    		// ID, so the two don't have the same shape.
    		githubUser, err := incident.GetCatalogType(ctx, &incident.LookupCatalogTypeArgs{
    			TypeName: pulumi.StringRef("GithubUser"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = incident.NewAlertAttribute(ctx, "github_user", &incident.AlertAttributeArgs{
    			Name:     pulumi.String("Github user"),
    			Type:     pulumi.String(githubUser.AttributeType),
    			Array:    pulumi.Bool(false),
    			Required: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		// Create an optional alert attribute for severity information
    		_, err = incident.NewAlertAttribute(ctx, "severity", &incident.AlertAttributeArgs{
    			Name:     pulumi.String("Severity"),
    			Type:     pulumi.String("String"),
    			Array:    pulumi.Bool(false),
    			Required: pulumi.Bool(false),
    			Emoji:    pulumi.String("warning"),
    		})
    		if err != nil {
    			return err
    		}
    		// An attribute is account-wide, so declare it once. What differs between environments is the
    		// binding that fills it in, which belongs to an alert source.
    		gcpService, err := incident.NewAlertAttribute(ctx, "gcp_service", &incident.AlertAttributeArgs{
    			Name:  pulumi.String("GCP service"),
    			Type:  pulumi.String("String"),
    			Array: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		// Staging and production each parse the same attribute out of their own source, so both
    		// environments' alerts are labelled with one attribute that routes can match on.
    		_, err = incident.NewAlertSourceAttribute(ctx, "gcp_service_staging", &incident.AlertSourceAttributeArgs{
    			Expression: &incident.AlertSourceAttributeExpressionArgs{
    				Operations: incident.AlertSourceAttributeExpressionOperationArray{
    					&incident.AlertSourceAttributeExpressionOperationArgs{
    						Parse: &incident.AlertSourceAttributeExpressionOperationParseArgs{
    							Function: pulumi.String("$.resource.labels.service_name"),
    							As:       pulumi.String("String"),
    						},
    					},
    				},
    				StartFrom: pulumi.String("payload"),
    			},
    			AlertSourceId:    pulumi.Any(gcpStaging.Id),
    			AlertAttributeId: gcpService.ID().ToIDOutput().ToStringOutput(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = incident.NewAlertSourceAttribute(ctx, "gcp_service_production", &incident.AlertSourceAttributeArgs{
    			Expression: &incident.AlertSourceAttributeExpressionArgs{
    				Operations: incident.AlertSourceAttributeExpressionOperationArray{
    					&incident.AlertSourceAttributeExpressionOperationArgs{
    						Parse: &incident.AlertSourceAttributeExpressionOperationParseArgs{
    							Function: pulumi.String("$.resource.labels.service_name"),
    							As:       pulumi.String("String"),
    						},
    					},
    				},
    				StartFrom: pulumi.String("payload"),
    			},
    			AlertSourceId:    pulumi.Any(gcpProduction.Id),
    			AlertAttributeId: gcpService.ID().ToIDOutput().ToStringOutput(),
    		})
    		if err != nil {
    			return err
    		}
    		// Where a source lives in a different workspace to the attribute it binds, read the attribute
    		// by name rather than declaring it again. Two workspaces declaring the same name will both plan
    		// cleanly, and then the second one to apply will fail.
    		existingGcpService, err := incident.GetAlertAttribute(ctx, &incident.LookupAlertAttributeArgs{
    			Name: "GCP service",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = incident.NewAlertSourceAttribute(ctx, "gcp_service_other_workspace", &incident.AlertSourceAttributeArgs{
    			Expression: &incident.AlertSourceAttributeExpressionArgs{
    				Operations: incident.AlertSourceAttributeExpressionOperationArray{
    					&incident.AlertSourceAttributeExpressionOperationArgs{
    						Parse: &incident.AlertSourceAttributeExpressionOperationParseArgs{
    							Function: pulumi.String("$.resource.labels.service_name"),
    							As:       pulumi.String("String"),
    						},
    					},
    				},
    				StartFrom: pulumi.String("payload"),
    			},
    			AlertSourceId:    pulumi.Any(gcpOther.Id),
    			AlertAttributeId: pulumi.String(existingGcpService.Id),
    		})
    		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 an alert attribute that points at a single Github user in the catalog.
        //
        // Take the engine type from the catalog type itself rather than writing it out: a type one
        // of our integrations owns is referenced by its registry name, and a type you manage by its
        // ID, so the two don't have the same shape.
        var githubUser = Incident.GetCatalogType.Invoke(new()
        {
            TypeName = "GithubUser",
        });
    
        var githubUserAlertAttribute = new Incident.AlertAttribute("github_user", new()
        {
            Name = "Github user",
            Type = githubUser.Apply(getCatalogTypeResult => getCatalogTypeResult.AttributeType),
            Array = false,
            Required = true,
        });
    
        // Create an optional alert attribute for severity information
        var severity = new Incident.AlertAttribute("severity", new()
        {
            Name = "Severity",
            Type = "String",
            Array = false,
            Required = false,
            Emoji = "warning",
        });
    
        // An attribute is account-wide, so declare it once. What differs between environments is the
        // binding that fills it in, which belongs to an alert source.
        var gcpService = new Incident.AlertAttribute("gcp_service", new()
        {
            Name = "GCP service",
            Type = "String",
            Array = false,
        });
    
        // Staging and production each parse the same attribute out of their own source, so both
        // environments' alerts are labelled with one attribute that routes can match on.
        var gcpServiceStaging = new Incident.AlertSourceAttribute("gcp_service_staging", new()
        {
            Expression = new Incident.Inputs.AlertSourceAttributeExpressionArgs
            {
                Operations = new[]
                {
                    new Incident.Inputs.AlertSourceAttributeExpressionOperationArgs
                    {
                        Parse = new Incident.Inputs.AlertSourceAttributeExpressionOperationParseArgs
                        {
                            Function = "$.resource.labels.service_name",
                            As = "String",
                        },
                    },
                },
                StartFrom = "payload",
            },
            AlertSourceId = gcpStaging.Id,
            AlertAttributeId = gcpService.Id,
        });
    
        var gcpServiceProduction = new Incident.AlertSourceAttribute("gcp_service_production", new()
        {
            Expression = new Incident.Inputs.AlertSourceAttributeExpressionArgs
            {
                Operations = new[]
                {
                    new Incident.Inputs.AlertSourceAttributeExpressionOperationArgs
                    {
                        Parse = new Incident.Inputs.AlertSourceAttributeExpressionOperationParseArgs
                        {
                            Function = "$.resource.labels.service_name",
                            As = "String",
                        },
                    },
                },
                StartFrom = "payload",
            },
            AlertSourceId = gcpProduction.Id,
            AlertAttributeId = gcpService.Id,
        });
    
        // Where a source lives in a different workspace to the attribute it binds, read the attribute
        // by name rather than declaring it again. Two workspaces declaring the same name will both plan
        // cleanly, and then the second one to apply will fail.
        var existingGcpService = Incident.GetAlertAttribute.Invoke(new()
        {
            Name = "GCP service",
        });
    
        var gcpServiceOtherWorkspace = new Incident.AlertSourceAttribute("gcp_service_other_workspace", new()
        {
            Expression = new Incident.Inputs.AlertSourceAttributeExpressionArgs
            {
                Operations = new[]
                {
                    new Incident.Inputs.AlertSourceAttributeExpressionOperationArgs
                    {
                        Parse = new Incident.Inputs.AlertSourceAttributeExpressionOperationParseArgs
                        {
                            Function = "$.resource.labels.service_name",
                            As = "String",
                        },
                    },
                },
                StartFrom = "payload",
            },
            AlertSourceId = gcpOther.Id,
            AlertAttributeId = existingGcpService.Apply(getAlertAttributeResult => getAlertAttributeResult.Id),
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.incident.IncidentFunctions;
    import com.pulumi.incident.inputs.GetCatalogTypeArgs;
    import com.pulumi.incident.AlertAttribute;
    import com.pulumi.incident.AlertAttributeArgs;
    import com.pulumi.incident.AlertSourceAttribute;
    import com.pulumi.incident.AlertSourceAttributeArgs;
    import com.pulumi.incident.inputs.AlertSourceAttributeExpressionArgs;
    import com.pulumi.incident.inputs.AlertSourceAttributeExpressionOperationArgs;
    import com.pulumi.incident.inputs.AlertSourceAttributeExpressionOperationParseArgs;
    import com.pulumi.incident.inputs.GetAlertAttributeArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 an alert attribute that points at a single Github user in the catalog.
            //
            // Take the engine type from the catalog type itself rather than writing it out: a type one
            // of our integrations owns is referenced by its registry name, and a type you manage by its
            // ID, so the two don't have the same shape.
            final var githubUser = IncidentFunctions.getCatalogType(GetCatalogTypeArgs.builder()
                .typeName("GithubUser")
                .build());
    
            var githubUserAlertAttribute = new AlertAttribute("githubUserAlertAttribute", AlertAttributeArgs.builder()
                .name("Github user")
                .type(githubUser.attributeType())
                .array(false)
                .required(true)
                .build());
    
            // Create an optional alert attribute for severity information
            var severity = new AlertAttribute("severity", AlertAttributeArgs.builder()
                .name("Severity")
                .type("String")
                .array(false)
                .required(false)
                .emoji("warning")
                .build());
    
            // An attribute is account-wide, so declare it once. What differs between environments is the
            // binding that fills it in, which belongs to an alert source.
            var gcpService = new AlertAttribute("gcpService", AlertAttributeArgs.builder()
                .name("GCP service")
                .type("String")
                .array(false)
                .build());
    
            // Staging and production each parse the same attribute out of their own source, so both
            // environments' alerts are labelled with one attribute that routes can match on.
            var gcpServiceStaging = new AlertSourceAttribute("gcpServiceStaging", AlertSourceAttributeArgs.builder()
                .expression(AlertSourceAttributeExpressionArgs.builder()
                    .operations(AlertSourceAttributeExpressionOperationArgs.builder()
                        .parse(AlertSourceAttributeExpressionOperationParseArgs.builder()
                            .function("$.resource.labels.service_name")
                            .as("String")
                            .build())
                        .build())
                    .startFrom("payload")
                    .build())
                .alertSourceId(gcpStaging.id())
                .alertAttributeId(gcpService.id())
                .build());
    
            var gcpServiceProduction = new AlertSourceAttribute("gcpServiceProduction", AlertSourceAttributeArgs.builder()
                .expression(AlertSourceAttributeExpressionArgs.builder()
                    .operations(AlertSourceAttributeExpressionOperationArgs.builder()
                        .parse(AlertSourceAttributeExpressionOperationParseArgs.builder()
                            .function("$.resource.labels.service_name")
                            .as("String")
                            .build())
                        .build())
                    .startFrom("payload")
                    .build())
                .alertSourceId(gcpProduction.id())
                .alertAttributeId(gcpService.id())
                .build());
    
            // Where a source lives in a different workspace to the attribute it binds, read the attribute
            // by name rather than declaring it again. Two workspaces declaring the same name will both plan
            // cleanly, and then the second one to apply will fail.
            final var existingGcpService = IncidentFunctions.getAlertAttribute(GetAlertAttributeArgs.builder()
                .name("GCP service")
                .build());
    
            var gcpServiceOtherWorkspace = new AlertSourceAttribute("gcpServiceOtherWorkspace", AlertSourceAttributeArgs.builder()
                .expression(AlertSourceAttributeExpressionArgs.builder()
                    .operations(AlertSourceAttributeExpressionOperationArgs.builder()
                        .parse(AlertSourceAttributeExpressionOperationParseArgs.builder()
                            .function("$.resource.labels.service_name")
                            .as("String")
                            .build())
                        .build())
                    .startFrom("payload")
                    .build())
                .alertSourceId(gcpOther.id())
                .alertAttributeId(existingGcpService.id())
                .build());
    
        }
    }
    
    resources:
      githubUserAlertAttribute:
        type: incident:AlertAttribute
        name: github_user
        properties:
          name: Github user
          type: ${githubUser.attributeType}
          array: false
          required: true
      # Create an optional alert attribute for severity information
      severity:
        type: incident:AlertAttribute
        properties:
          name: Severity
          type: String
          array: false
          required: false
          emoji: warning
      # An attribute is account-wide, so declare it once. What differs between environments is the
      # binding that fills it in, which belongs to an alert source.
      gcpService:
        type: incident:AlertAttribute
        name: gcp_service
        properties:
          name: GCP service
          type: String
          array: false
      # Staging and production each parse the same attribute out of their own source, so both
      # environments' alerts are labelled with one attribute that routes can match on.
      gcpServiceStaging:
        type: incident:AlertSourceAttribute
        name: gcp_service_staging
        properties:
          expression:
            operations:
              - parse:
                  function: $.resource.labels.service_name
                  as: String
            startFrom: payload
          alertSourceId: ${gcpStaging.id}
          alertAttributeId: ${gcpService.id}
      gcpServiceProduction:
        type: incident:AlertSourceAttribute
        name: gcp_service_production
        properties:
          expression:
            operations:
              - parse:
                  function: $.resource.labels.service_name
                  as: String
            startFrom: payload
          alertSourceId: ${gcpProduction.id}
          alertAttributeId: ${gcpService.id}
      gcpServiceOtherWorkspace:
        type: incident:AlertSourceAttribute
        name: gcp_service_other_workspace
        properties:
          expression:
            operations:
              - parse:
                  function: $.resource.labels.service_name
                  as: String
            startFrom: payload
          alertSourceId: ${gcpOther.id}
          alertAttributeId: ${existingGcpService.id}
    variables:
      # Create an alert attribute that points at a single Github user in the catalog.
      #
      # Take the engine type from the catalog type itself rather than writing it out: a type one
      # of our integrations owns is referenced by its registry name, and a type you manage by its
      # ID, so the two don't have the same shape.
      githubUser:
        fn::invoke:
          function: incident:getCatalogType
          arguments:
            typeName: GithubUser
      # Where a source lives in a different workspace to the attribute it binds, read the attribute
      # by name rather than declaring it again. Two workspaces declaring the same name will both plan
      # cleanly, and then the second one to apply will fail.
      existingGcpService:
        fn::invoke:
          function: incident:getAlertAttribute
          arguments:
            name: GCP service
    
    pulumi {
      required_providers {
        incident = {
          source = "pulumi/incident"
        }
      }
    }
    
    data "incident_getcatalogtype" "githubUser" {
      type_name = "GithubUser"
    }
    data "incident_getalertattribute" "existingGcpService" {
      name = "GCP service"
    }
    
    resource "incident_alertattribute" "github_user" {
      name     = "Github user"
      type     = data.incident_getcatalogtype.githubUser.attribute_type
      array    = false
      required = true
    }
    # Create an optional alert attribute for severity information
    resource "incident_alertattribute" "severity" {
      name     = "Severity"
      type     = "String"
      array    = false
      required = false
      emoji    = "warning"
    }
    # An attribute is account-wide, so declare it once. What differs between environments is the
    # binding that fills it in, which belongs to an alert source.
    resource "incident_alertattribute" "gcp_service" {
      name  = "GCP service"
      type  = "String"
      array = false
    }
    # Staging and production each parse the same attribute out of their own source, so both
    # environments' alerts are labelled with one attribute that routes can match on.
    resource "incident_alertsourceattribute" "gcp_service_staging" {
      expression = {
        operations = [{
          "parse" = {
            "function" = "$.resource.labels.service_name"
            "as"       = "String"
          }
        }]
        start_from = "payload"
      }
      alert_source_id    = gcpStaging.id
      alert_attribute_id = incident_alertattribute.gcp_service.id
    }
    resource "incident_alertsourceattribute" "gcp_service_production" {
      expression = {
        operations = [{
          "parse" = {
            "function" = "$.resource.labels.service_name"
            "as"       = "String"
          }
        }]
        start_from = "payload"
      }
      alert_source_id    = gcpProduction.id
      alert_attribute_id = incident_alertattribute.gcp_service.id
    }
    resource "incident_alertsourceattribute" "gcp_service_other_workspace" {
      expression = {
        operations = [{
          "parse" = {
            "function" = "$.resource.labels.service_name"
            "as"       = "String"
          }
        }]
        start_from = "payload"
      }
      alert_source_id    = gcpOther.id
      alert_attribute_id = data.incident_getalertattribute.existingGcpService.id
    }
    # Create an alert attribute that points at a single Github user in the catalog.
    #
    # Take the engine type from the catalog type itself rather than writing it out: a type one
    # of our integrations owns is referenced by its registry name, and a type you manage by its
    # ID, so the two don't have the same shape.
    # Where a source lives in a different workspace to the attribute it binds, read the attribute
    # by name rather than declaring it again. Two workspaces declaring the same name will both plan
    # cleanly, and then the second one to apply will fail.
    

    Create AlertAttribute Resource

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

    Constructor syntax

    new AlertAttribute(name: string, args: AlertAttributeArgs, opts?: CustomResourceOptions);
    @overload
    def AlertAttribute(resource_name: str,
                       args: AlertAttributeArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def AlertAttribute(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       array: Optional[bool] = None,
                       type: Optional[str] = None,
                       emoji: Optional[str] = None,
                       name: Optional[str] = None,
                       required: Optional[bool] = None)
    func NewAlertAttribute(ctx *Context, name string, args AlertAttributeArgs, opts ...ResourceOption) (*AlertAttribute, error)
    public AlertAttribute(string name, AlertAttributeArgs args, CustomResourceOptions? opts = null)
    public AlertAttribute(String name, AlertAttributeArgs args)
    public AlertAttribute(String name, AlertAttributeArgs args, CustomResourceOptions options)
    
    type: incident:AlertAttribute
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "incident_alert_attribute" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args AlertAttributeArgs
    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 AlertAttributeArgs
    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 AlertAttributeArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlertAttributeArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlertAttributeArgs
    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 alertAttributeResource = new Incident.AlertAttribute("alertAttributeResource", new()
    {
        Array = false,
        Type = "string",
        Emoji = "string",
        Name = "string",
        Required = false,
    });
    
    example, err := incident.NewAlertAttribute(ctx, "alertAttributeResource", &incident.AlertAttributeArgs{
    	Array:    pulumi.Bool(false),
    	Type:     pulumi.String("string"),
    	Emoji:    pulumi.String("string"),
    	Name:     pulumi.String("string"),
    	Required: pulumi.Bool(false),
    })
    
    resource "incident_alert_attribute" "alertAttributeResource" {
      lifecycle {
        create_before_destroy = true
      }
      array    = false
      type     = "string"
      emoji    = "string"
      name     = "string"
      required = false
    }
    
    var alertAttributeResource = new AlertAttribute("alertAttributeResource", AlertAttributeArgs.builder()
        .array(false)
        .type("string")
        .emoji("string")
        .name("string")
        .required(false)
        .build());
    
    alert_attribute_resource = incident.AlertAttribute("alertAttributeResource",
        array=False,
        type="string",
        emoji="string",
        name="string",
        required=False)
    
    const alertAttributeResource = new incident.AlertAttribute("alertAttributeResource", {
        array: false,
        type: "string",
        emoji: "string",
        name: "string",
        required: false,
    });
    
    type: incident:AlertAttribute
    properties:
        array: false
        emoji: string
        name: string
        required: false
        type: string
    

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

    Array bool
    Whether this attribute is an array
    Type string
    Engine resource name for this attribute
    Emoji string
    The emoji to display alongside this attribute in chat messages, stored without colons
    Name string
    Unique name of this attribute
    Required bool
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    Array bool
    Whether this attribute is an array
    Type string
    Engine resource name for this attribute
    Emoji string
    The emoji to display alongside this attribute in chat messages, stored without colons
    Name string
    Unique name of this attribute
    Required bool
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    array bool
    Whether this attribute is an array
    type string
    Engine resource name for this attribute
    emoji string
    The emoji to display alongside this attribute in chat messages, stored without colons
    name string
    Unique name of this attribute
    required bool
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    array Boolean
    Whether this attribute is an array
    type String
    Engine resource name for this attribute
    emoji String
    The emoji to display alongside this attribute in chat messages, stored without colons
    name String
    Unique name of this attribute
    required Boolean
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    array boolean
    Whether this attribute is an array
    type string
    Engine resource name for this attribute
    emoji string
    The emoji to display alongside this attribute in chat messages, stored without colons
    name string
    Unique name of this attribute
    required boolean
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    array bool
    Whether this attribute is an array
    type str
    Engine resource name for this attribute
    emoji str
    The emoji to display alongside this attribute in chat messages, stored without colons
    name str
    Unique name of this attribute
    required bool
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    array Boolean
    Whether this attribute is an array
    type String
    Engine resource name for this attribute
    emoji String
    The emoji to display alongside this attribute in chat messages, stored without colons
    name String
    Unique name of this attribute
    required Boolean
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.

    Outputs

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

    Get an existing AlertAttribute 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?: AlertAttributeState, opts?: CustomResourceOptions): AlertAttribute
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            array: Optional[bool] = None,
            emoji: Optional[str] = None,
            name: Optional[str] = None,
            required: Optional[bool] = None,
            type: Optional[str] = None) -> AlertAttribute
    func GetAlertAttribute(ctx *Context, name string, id IDInput, state *AlertAttributeState, opts ...ResourceOption) (*AlertAttribute, error)
    public static AlertAttribute Get(string name, Input<string> id, AlertAttributeState? state, CustomResourceOptions? opts = null)
    public static AlertAttribute get(String name, Output<String> id, AlertAttributeState state, CustomResourceOptions options)
    resources:  _:    type: incident:AlertAttribute    get:      id: ${id}
    import {
      to = incident_alert_attribute.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:
    Array bool
    Whether this attribute is an array
    Emoji string
    The emoji to display alongside this attribute in chat messages, stored without colons
    Name string
    Unique name of this attribute
    Required bool
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    Type string
    Engine resource name for this attribute
    Array bool
    Whether this attribute is an array
    Emoji string
    The emoji to display alongside this attribute in chat messages, stored without colons
    Name string
    Unique name of this attribute
    Required bool
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    Type string
    Engine resource name for this attribute
    array bool
    Whether this attribute is an array
    emoji string
    The emoji to display alongside this attribute in chat messages, stored without colons
    name string
    Unique name of this attribute
    required bool
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    type string
    Engine resource name for this attribute
    array Boolean
    Whether this attribute is an array
    emoji String
    The emoji to display alongside this attribute in chat messages, stored without colons
    name String
    Unique name of this attribute
    required Boolean
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    type String
    Engine resource name for this attribute
    array boolean
    Whether this attribute is an array
    emoji string
    The emoji to display alongside this attribute in chat messages, stored without colons
    name string
    Unique name of this attribute
    required boolean
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    type string
    Engine resource name for this attribute
    array bool
    Whether this attribute is an array
    emoji str
    The emoji to display alongside this attribute in chat messages, stored without colons
    name str
    Unique name of this attribute
    required bool
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    type str
    Engine resource name for this attribute
    array Boolean
    Whether this attribute is an array
    emoji String
    The emoji to display alongside this attribute in chat messages, stored without colons
    name String
    Unique name of this attribute
    required Boolean
    Whether this attribute is required. If this field is not set, the existing setting will be preserved.
    type String
    Engine resource name for this attribute

    Package Details

    Repository
    incident incident-io/pulumi-incident
    License
    MIT
    Notes
    This Pulumi package is based on the incident Terraform Provider.
    incident logo incident.io
    Viewing docs for incident.io v0.4.1
    published on Wednesday, Oct 21, 2026 by incident-io

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial