1. Packages
  2. Packages
  3. Rootly
  4. API Docs
  5. AlertRoute
Viewing docs for Rootly v3.3.0
published on Thursday, May 7, 2026 by rootlyhq
rootly logo
Viewing docs for Rootly v3.3.0
published on Thursday, May 7, 2026 by rootlyhq

    Example Usage

    data "rootly_user" "user_1" {
      email = "john@example.com"
    }
    
    # Create teams and escalation policies to set as destinations/owner teams
    resource "rootly_team" "on_call_team" {
      name     = "On-Call Team"
      user_ids = [data.rootly_user.user_1.id]
    }
    
    resource "rootly_team" "security_team" {
      name     = "Security Team"
      user_ids = [data.rootly_user.user_1.id]
    }
    
    resource "rootly_escalation_policy" "production_ep" {
      name      = "Production Escalation"
      group_ids = [rootly_team.on_call_team.id]
    }
    
    resource "rootly_escalation_policy" "security_ep" {
      name      = "Security Escalation"
      group_ids = [rootly_team.security_team.id]
    }
    
    # Create alert fields for rule conditions
    resource "rootly_alert_field" "severity_field" {
      name = "Severity"
    }
    
    resource "rootly_alert_field" "service_field" {
      name = "Service"
    }
    
    # Create alert source to route from
    resource "rootly_alerts_source" "monitoring_source" {
      name        = "Production Monitoring"
      source_type = "generic_webhook"
    
      alert_source_fields_attributes {
        alert_field_id = "538914bc-27d5-40d4-944b-ab1d71cc59b6" # Built-in title field
        template_body  = "{{ alert.title }}"
      }
    
      alert_source_fields_attributes {
        alert_field_id = resource.rootly_alert_field.severity_field.id
        template_body  = "{{ alert.severity }}"
      }
    }
    
    # Create alert route with multiple rules
    resource "rootly_alert_route" "production_route" {
      name              = "Production Alert Routing"
      alerts_source_ids = [resource.rootly_alerts_source.monitoring_source.id]
      owning_team_ids   = [resource.rootly_team.on_call_team.id]
      enabled           = true
    
      rules {
        name = "High Severity Route"
        destinations {
          target_type = "EscalationPolicy"
          target_id   = rootly_escalation_policy.production_ep.id
        }
        condition_groups {
          position = 1
          conditions {
            conditionable_type            = "AlertField"
            conditionable_id              = resource.rootly_alert_field.severity_field.id
            property_field_type           = "alert_field"
            property_field_condition_type = "is_one_of"
            property_field_values         = ["sev0", "sev1"]
          }
        }
      }
    
      rules {
        name = "Security Route"
        destinations {
          target_type = "EscalationPolicy"
          target_id   = rootly_escalation_policy.security_ep.id
        }
        condition_groups {
          position = 1
          conditions {
            conditionable_type            = "AlertField"
            conditionable_id              = resource.rootly_alert_field.service_field.id
            property_field_type           = "alert_field"
            property_field_condition_type = "contains"
            property_field_value          = "security"
          }
        }
      }
    
      rules {
        destinations {
          target_type = "EscalationPolicy"
          target_id   = rootly_escalation_policy.production_ep.id
        }
        fallback_rule = true
      }
    }
    

    Create AlertRoute Resource

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

    Constructor syntax

    new AlertRoute(name: string, args: AlertRouteArgs, opts?: CustomResourceOptions);
    @overload
    def AlertRoute(resource_name: str,
                   args: AlertRouteArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def AlertRoute(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   alerts_source_ids: Optional[Sequence[str]] = None,
                   enabled: Optional[bool] = None,
                   name: Optional[str] = None,
                   owning_team_ids: Optional[Sequence[str]] = None,
                   rules: Optional[Sequence[AlertRouteRuleArgs]] = None)
    func NewAlertRoute(ctx *Context, name string, args AlertRouteArgs, opts ...ResourceOption) (*AlertRoute, error)
    public AlertRoute(string name, AlertRouteArgs args, CustomResourceOptions? opts = null)
    public AlertRoute(String name, AlertRouteArgs args)
    public AlertRoute(String name, AlertRouteArgs args, CustomResourceOptions options)
    
    type: rootly:AlertRoute
    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 AlertRouteArgs
    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 AlertRouteArgs
    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 AlertRouteArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AlertRouteArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AlertRouteArgs
    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 alertRouteResource = new Rootly.AlertRoute("alertRouteResource", new()
    {
        AlertsSourceIds = new[]
        {
            "string",
        },
        Enabled = false,
        Name = "string",
        OwningTeamIds = new[]
        {
            "string",
        },
        Rules = new[]
        {
            new Rootly.Inputs.AlertRouteRuleArgs
            {
                ConditionGroups = new[]
                {
                    new Rootly.Inputs.AlertRouteRuleConditionGroupArgs
                    {
                        Conditions = new[]
                        {
                            new Rootly.Inputs.AlertRouteRuleConditionGroupConditionArgs
                            {
                                AlertUrgencyIds = new[]
                                {
                                    "string",
                                },
                                ConditionableId = "string",
                                ConditionableType = "string",
                                PropertyFieldConditionType = "string",
                                PropertyFieldName = "string",
                                PropertyFieldType = "string",
                                PropertyFieldValue = "string",
                                PropertyFieldValues = new[]
                                {
                                    "string",
                                },
                            },
                        },
                        Position = 0,
                    },
                },
                Destinations = new[]
                {
                    new Rootly.Inputs.AlertRouteRuleDestinationArgs
                    {
                        TargetId = "string",
                        TargetType = "string",
                    },
                },
                FallbackRule = false,
                Name = "string",
                Position = 0,
            },
        },
    });
    
    example, err := rootly.NewAlertRoute(ctx, "alertRouteResource", &rootly.AlertRouteArgs{
    	AlertsSourceIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Enabled: pulumi.Bool(false),
    	Name:    pulumi.String("string"),
    	OwningTeamIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Rules: rootly.AlertRouteRuleArray{
    		&rootly.AlertRouteRuleArgs{
    			ConditionGroups: rootly.AlertRouteRuleConditionGroupArray{
    				&rootly.AlertRouteRuleConditionGroupArgs{
    					Conditions: rootly.AlertRouteRuleConditionGroupConditionArray{
    						&rootly.AlertRouteRuleConditionGroupConditionArgs{
    							AlertUrgencyIds: pulumi.StringArray{
    								pulumi.String("string"),
    							},
    							ConditionableId:            pulumi.String("string"),
    							ConditionableType:          pulumi.String("string"),
    							PropertyFieldConditionType: pulumi.String("string"),
    							PropertyFieldName:          pulumi.String("string"),
    							PropertyFieldType:          pulumi.String("string"),
    							PropertyFieldValue:         pulumi.String("string"),
    							PropertyFieldValues: pulumi.StringArray{
    								pulumi.String("string"),
    							},
    						},
    					},
    					Position: pulumi.Int(0),
    				},
    			},
    			Destinations: rootly.AlertRouteRuleDestinationArray{
    				&rootly.AlertRouteRuleDestinationArgs{
    					TargetId:   pulumi.String("string"),
    					TargetType: pulumi.String("string"),
    				},
    			},
    			FallbackRule: pulumi.Bool(false),
    			Name:         pulumi.String("string"),
    			Position:     pulumi.Int(0),
    		},
    	},
    })
    
    var alertRouteResource = new AlertRoute("alertRouteResource", AlertRouteArgs.builder()
        .alertsSourceIds("string")
        .enabled(false)
        .name("string")
        .owningTeamIds("string")
        .rules(AlertRouteRuleArgs.builder()
            .conditionGroups(AlertRouteRuleConditionGroupArgs.builder()
                .conditions(AlertRouteRuleConditionGroupConditionArgs.builder()
                    .alertUrgencyIds("string")
                    .conditionableId("string")
                    .conditionableType("string")
                    .propertyFieldConditionType("string")
                    .propertyFieldName("string")
                    .propertyFieldType("string")
                    .propertyFieldValue("string")
                    .propertyFieldValues("string")
                    .build())
                .position(0)
                .build())
            .destinations(AlertRouteRuleDestinationArgs.builder()
                .targetId("string")
                .targetType("string")
                .build())
            .fallbackRule(false)
            .name("string")
            .position(0)
            .build())
        .build());
    
    alert_route_resource = rootly.AlertRoute("alertRouteResource",
        alerts_source_ids=["string"],
        enabled=False,
        name="string",
        owning_team_ids=["string"],
        rules=[{
            "condition_groups": [{
                "conditions": [{
                    "alert_urgency_ids": ["string"],
                    "conditionable_id": "string",
                    "conditionable_type": "string",
                    "property_field_condition_type": "string",
                    "property_field_name": "string",
                    "property_field_type": "string",
                    "property_field_value": "string",
                    "property_field_values": ["string"],
                }],
                "position": 0,
            }],
            "destinations": [{
                "target_id": "string",
                "target_type": "string",
            }],
            "fallback_rule": False,
            "name": "string",
            "position": 0,
        }])
    
    const alertRouteResource = new rootly.AlertRoute("alertRouteResource", {
        alertsSourceIds: ["string"],
        enabled: false,
        name: "string",
        owningTeamIds: ["string"],
        rules: [{
            conditionGroups: [{
                conditions: [{
                    alertUrgencyIds: ["string"],
                    conditionableId: "string",
                    conditionableType: "string",
                    propertyFieldConditionType: "string",
                    propertyFieldName: "string",
                    propertyFieldType: "string",
                    propertyFieldValue: "string",
                    propertyFieldValues: ["string"],
                }],
                position: 0,
            }],
            destinations: [{
                targetId: "string",
                targetType: "string",
            }],
            fallbackRule: false,
            name: "string",
            position: 0,
        }],
    });
    
    type: rootly:AlertRoute
    properties:
        alertsSourceIds:
            - string
        enabled: false
        name: string
        owningTeamIds:
            - string
        rules:
            - conditionGroups:
                - conditions:
                    - alertUrgencyIds:
                        - string
                      conditionableId: string
                      conditionableType: string
                      propertyFieldConditionType: string
                      propertyFieldName: string
                      propertyFieldType: string
                      propertyFieldValue: string
                      propertyFieldValues:
                        - string
                  position: 0
              destinations:
                - targetId: string
                  targetType: string
              fallbackRule: false
              name: string
              position: 0
    

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

    AlertsSourceIds List<string>
    Enabled bool
    Name string
    The name of the alert route
    OwningTeamIds List<string>
    Rules List<AlertRouteRule>
    AlertsSourceIds []string
    Enabled bool
    Name string
    The name of the alert route
    OwningTeamIds []string
    Rules []AlertRouteRuleArgs
    alertsSourceIds List<String>
    enabled Boolean
    name String
    The name of the alert route
    owningTeamIds List<String>
    rules List<AlertRouteRule>
    alertsSourceIds string[]
    enabled boolean
    name string
    The name of the alert route
    owningTeamIds string[]
    rules AlertRouteRule[]
    alerts_source_ids Sequence[str]
    enabled bool
    name str
    The name of the alert route
    owning_team_ids Sequence[str]
    rules Sequence[AlertRouteRuleArgs]
    alertsSourceIds List<String>
    enabled Boolean
    name String
    The name of the alert route
    owningTeamIds List<String>
    rules List<Property Map>

    Outputs

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

    Get an existing AlertRoute 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?: AlertRouteState, opts?: CustomResourceOptions): AlertRoute
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            alerts_source_ids: Optional[Sequence[str]] = None,
            enabled: Optional[bool] = None,
            name: Optional[str] = None,
            owning_team_ids: Optional[Sequence[str]] = None,
            rules: Optional[Sequence[AlertRouteRuleArgs]] = None) -> AlertRoute
    func GetAlertRoute(ctx *Context, name string, id IDInput, state *AlertRouteState, opts ...ResourceOption) (*AlertRoute, error)
    public static AlertRoute Get(string name, Input<string> id, AlertRouteState? state, CustomResourceOptions? opts = null)
    public static AlertRoute get(String name, Output<String> id, AlertRouteState state, CustomResourceOptions options)
    resources:  _:    type: rootly:AlertRoute    get:      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:
    AlertsSourceIds List<string>
    Enabled bool
    Name string
    The name of the alert route
    OwningTeamIds List<string>
    Rules List<AlertRouteRule>
    AlertsSourceIds []string
    Enabled bool
    Name string
    The name of the alert route
    OwningTeamIds []string
    Rules []AlertRouteRuleArgs
    alertsSourceIds List<String>
    enabled Boolean
    name String
    The name of the alert route
    owningTeamIds List<String>
    rules List<AlertRouteRule>
    alertsSourceIds string[]
    enabled boolean
    name string
    The name of the alert route
    owningTeamIds string[]
    rules AlertRouteRule[]
    alerts_source_ids Sequence[str]
    enabled bool
    name str
    The name of the alert route
    owning_team_ids Sequence[str]
    rules Sequence[AlertRouteRuleArgs]
    alertsSourceIds List<String>
    enabled Boolean
    name String
    The name of the alert route
    owningTeamIds List<String>
    rules List<Property Map>

    Supporting Types

    AlertRouteRule, AlertRouteRuleArgs

    ConditionGroups List<AlertRouteRuleConditionGroup>
    Must be specified if fallbackRule is false.
    Destinations List<AlertRouteRuleDestination>
    FallbackRule bool
    Whether this is a fallback rule. Must be true if conditionGroups is not specified.
    Name string
    The name of the alert routing rule
    Position int
    The position of the alert routing rule for ordering evaluation
    ConditionGroups []AlertRouteRuleConditionGroup
    Must be specified if fallbackRule is false.
    Destinations []AlertRouteRuleDestination
    FallbackRule bool
    Whether this is a fallback rule. Must be true if conditionGroups is not specified.
    Name string
    The name of the alert routing rule
    Position int
    The position of the alert routing rule for ordering evaluation
    conditionGroups List<AlertRouteRuleConditionGroup>
    Must be specified if fallbackRule is false.
    destinations List<AlertRouteRuleDestination>
    fallbackRule Boolean
    Whether this is a fallback rule. Must be true if conditionGroups is not specified.
    name String
    The name of the alert routing rule
    position Integer
    The position of the alert routing rule for ordering evaluation
    conditionGroups AlertRouteRuleConditionGroup[]
    Must be specified if fallbackRule is false.
    destinations AlertRouteRuleDestination[]
    fallbackRule boolean
    Whether this is a fallback rule. Must be true if conditionGroups is not specified.
    name string
    The name of the alert routing rule
    position number
    The position of the alert routing rule for ordering evaluation
    condition_groups Sequence[AlertRouteRuleConditionGroup]
    Must be specified if fallbackRule is false.
    destinations Sequence[AlertRouteRuleDestination]
    fallback_rule bool
    Whether this is a fallback rule. Must be true if conditionGroups is not specified.
    name str
    The name of the alert routing rule
    position int
    The position of the alert routing rule for ordering evaluation
    conditionGroups List<Property Map>
    Must be specified if fallbackRule is false.
    destinations List<Property Map>
    fallbackRule Boolean
    Whether this is a fallback rule. Must be true if conditionGroups is not specified.
    name String
    The name of the alert routing rule
    position Number
    The position of the alert routing rule for ordering evaluation

    AlertRouteRuleConditionGroup, AlertRouteRuleConditionGroupArgs

    Conditions []AlertRouteRuleConditionGroupCondition
    Position int
    The position of the condition group
    conditions List<AlertRouteRuleConditionGroupCondition>
    position Integer
    The position of the condition group
    conditions AlertRouteRuleConditionGroupCondition[]
    position number
    The position of the condition group
    conditions List<Property Map>
    position Number
    The position of the condition group

    AlertRouteRuleConditionGroupCondition, AlertRouteRuleConditionGroupConditionArgs

    AlertUrgencyIds List<string>
    The Alert Urgency IDs to check in the condition
    ConditionableId string
    The ID of the conditionable
    ConditionableType string
    The type of the conditionable. Value must be one of AlertField.
    PropertyFieldConditionType string
    Value must be one of isOneOf, isNotOneOf, contains, doesNotContain, startsWith, endsWith, matchesRegex, isEmpty.
    PropertyFieldName string
    The name of the property field
    PropertyFieldType string
    Value must be one of attribute, payload, alertField.
    PropertyFieldValue string
    The value of the property field
    PropertyFieldValues List<string>
    AlertUrgencyIds []string
    The Alert Urgency IDs to check in the condition
    ConditionableId string
    The ID of the conditionable
    ConditionableType string
    The type of the conditionable. Value must be one of AlertField.
    PropertyFieldConditionType string
    Value must be one of isOneOf, isNotOneOf, contains, doesNotContain, startsWith, endsWith, matchesRegex, isEmpty.
    PropertyFieldName string
    The name of the property field
    PropertyFieldType string
    Value must be one of attribute, payload, alertField.
    PropertyFieldValue string
    The value of the property field
    PropertyFieldValues []string
    alertUrgencyIds List<String>
    The Alert Urgency IDs to check in the condition
    conditionableId String
    The ID of the conditionable
    conditionableType String
    The type of the conditionable. Value must be one of AlertField.
    propertyFieldConditionType String
    Value must be one of isOneOf, isNotOneOf, contains, doesNotContain, startsWith, endsWith, matchesRegex, isEmpty.
    propertyFieldName String
    The name of the property field
    propertyFieldType String
    Value must be one of attribute, payload, alertField.
    propertyFieldValue String
    The value of the property field
    propertyFieldValues List<String>
    alertUrgencyIds string[]
    The Alert Urgency IDs to check in the condition
    conditionableId string
    The ID of the conditionable
    conditionableType string
    The type of the conditionable. Value must be one of AlertField.
    propertyFieldConditionType string
    Value must be one of isOneOf, isNotOneOf, contains, doesNotContain, startsWith, endsWith, matchesRegex, isEmpty.
    propertyFieldName string
    The name of the property field
    propertyFieldType string
    Value must be one of attribute, payload, alertField.
    propertyFieldValue string
    The value of the property field
    propertyFieldValues string[]
    alert_urgency_ids Sequence[str]
    The Alert Urgency IDs to check in the condition
    conditionable_id str
    The ID of the conditionable
    conditionable_type str
    The type of the conditionable. Value must be one of AlertField.
    property_field_condition_type str
    Value must be one of isOneOf, isNotOneOf, contains, doesNotContain, startsWith, endsWith, matchesRegex, isEmpty.
    property_field_name str
    The name of the property field
    property_field_type str
    Value must be one of attribute, payload, alertField.
    property_field_value str
    The value of the property field
    property_field_values Sequence[str]
    alertUrgencyIds List<String>
    The Alert Urgency IDs to check in the condition
    conditionableId String
    The ID of the conditionable
    conditionableType String
    The type of the conditionable. Value must be one of AlertField.
    propertyFieldConditionType String
    Value must be one of isOneOf, isNotOneOf, contains, doesNotContain, startsWith, endsWith, matchesRegex, isEmpty.
    propertyFieldName String
    The name of the property field
    propertyFieldType String
    Value must be one of attribute, payload, alertField.
    propertyFieldValue String
    The value of the property field
    propertyFieldValues List<String>

    AlertRouteRuleDestination, AlertRouteRuleDestinationArgs

    TargetId string
    The ID of the target
    TargetType string
    The type of the target. Value must be one of Service, Group, EscalationPolicy.
    TargetId string
    The ID of the target
    TargetType string
    The type of the target. Value must be one of Service, Group, EscalationPolicy.
    targetId String
    The ID of the target
    targetType String
    The type of the target. Value must be one of Service, Group, EscalationPolicy.
    targetId string
    The ID of the target
    targetType string
    The type of the target. Value must be one of Service, Group, EscalationPolicy.
    target_id str
    The ID of the target
    target_type str
    The type of the target. Value must be one of Service, Group, EscalationPolicy.
    targetId String
    The ID of the target
    targetType String
    The type of the target. Value must be one of Service, Group, EscalationPolicy.

    Import

    rootly.AlertRoute can be imported using the import command.

    $ pulumi import rootly:index/alertRoute:AlertRoute primary a816421c-6ceb-481a-87c4-585e47451f24
    

    Or using an import block.

    Locate the resource id in the web app, or retrieve it by listing resources through the API if it’s not visible in the web app.

    HCL can be generated from the import block using the -generate-config-out flag.

    pulumi preview -generate-config-out=generated.tf
    

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

    Package Details

    Repository
    rootly rootlyhq/pulumi-rootly
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rootly Terraform Provider.
    rootly logo
    Viewing docs for Rootly v3.3.0
    published on Thursday, May 7, 2026 by rootlyhq
      Try Pulumi Cloud free. Your team will thank you.