published on Thursday, May 7, 2026 by rootlyhq
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:
- Alerts
Source List<string>Ids - Enabled bool
- Name string
- The name of the alert route
- Owning
Team List<string>Ids - Rules
List<Alert
Route Rule>
- Alerts
Source []stringIds - Enabled bool
- Name string
- The name of the alert route
- Owning
Team []stringIds - Rules
[]Alert
Route Rule Args
- alerts
Source List<String>Ids - enabled Boolean
- name String
- The name of the alert route
- owning
Team List<String>Ids - rules
List<Alert
Route Rule>
- alerts
Source string[]Ids - enabled boolean
- name string
- The name of the alert route
- owning
Team string[]Ids - rules
Alert
Route Rule[]
- alerts_
source_ Sequence[str]ids - enabled bool
- name str
- The name of the alert route
- owning_
team_ Sequence[str]ids - rules
Sequence[Alert
Route Rule Args]
- alerts
Source List<String>Ids - enabled Boolean
- name String
- The name of the alert route
- owning
Team List<String>Ids - 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) -> AlertRoutefunc 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.
- Alerts
Source List<string>Ids - Enabled bool
- Name string
- The name of the alert route
- Owning
Team List<string>Ids - Rules
List<Alert
Route Rule>
- Alerts
Source []stringIds - Enabled bool
- Name string
- The name of the alert route
- Owning
Team []stringIds - Rules
[]Alert
Route Rule Args
- alerts
Source List<String>Ids - enabled Boolean
- name String
- The name of the alert route
- owning
Team List<String>Ids - rules
List<Alert
Route Rule>
- alerts
Source string[]Ids - enabled boolean
- name string
- The name of the alert route
- owning
Team string[]Ids - rules
Alert
Route Rule[]
- alerts_
source_ Sequence[str]ids - enabled bool
- name str
- The name of the alert route
- owning_
team_ Sequence[str]ids - rules
Sequence[Alert
Route Rule Args]
- alerts
Source List<String>Ids - enabled Boolean
- name String
- The name of the alert route
- owning
Team List<String>Ids - rules List<Property Map>
Supporting Types
AlertRouteRule, AlertRouteRuleArgs
- Condition
Groups List<AlertRoute Rule Condition Group> - Must be specified if
fallbackRuleisfalse. - Destinations
List<Alert
Route Rule Destination> - Fallback
Rule bool - Whether this is a fallback rule. Must be
trueifconditionGroupsis not specified. - Name string
- The name of the alert routing rule
- Position int
- The position of the alert routing rule for ordering evaluation
- Condition
Groups []AlertRoute Rule Condition Group - Must be specified if
fallbackRuleisfalse. - Destinations
[]Alert
Route Rule Destination - Fallback
Rule bool - Whether this is a fallback rule. Must be
trueifconditionGroupsis not specified. - Name string
- The name of the alert routing rule
- Position int
- The position of the alert routing rule for ordering evaluation
- condition
Groups List<AlertRoute Rule Condition Group> - Must be specified if
fallbackRuleisfalse. - destinations
List<Alert
Route Rule Destination> - fallback
Rule Boolean - Whether this is a fallback rule. Must be
trueifconditionGroupsis not specified. - name String
- The name of the alert routing rule
- position Integer
- The position of the alert routing rule for ordering evaluation
- condition
Groups AlertRoute Rule Condition Group[] - Must be specified if
fallbackRuleisfalse. - destinations
Alert
Route Rule Destination[] - fallback
Rule boolean - Whether this is a fallback rule. Must be
trueifconditionGroupsis 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[AlertRoute Rule Condition Group] - Must be specified if
fallbackRuleisfalse. - destinations
Sequence[Alert
Route Rule Destination] - fallback_
rule bool - Whether this is a fallback rule. Must be
trueifconditionGroupsis not specified. - name str
- The name of the alert routing rule
- position int
- The position of the alert routing rule for ordering evaluation
- condition
Groups List<Property Map> - Must be specified if
fallbackRuleisfalse. - destinations List<Property Map>
- fallback
Rule Boolean - Whether this is a fallback rule. Must be
trueifconditionGroupsis 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
List<Alert
Route Rule Condition Group Condition> - Position int
- The position of the condition group
- Conditions
[]Alert
Route Rule Condition Group Condition - Position int
- The position of the condition group
- conditions
List<Alert
Route Rule Condition Group Condition> - position Integer
- The position of the condition group
- conditions
Alert
Route Rule Condition Group Condition[] - position number
- The position of the condition group
- conditions
Sequence[Alert
Route Rule Condition Group Condition] - position int
- The position of the condition group
- conditions List<Property Map>
- position Number
- The position of the condition group
AlertRouteRuleConditionGroupCondition, AlertRouteRuleConditionGroupConditionArgs
- Alert
Urgency List<string>Ids - The Alert Urgency IDs to check in the condition
- Conditionable
Id string - The ID of the conditionable
- Conditionable
Type string - The type of the conditionable. Value must be one of
AlertField. - Property
Field stringCondition Type - Value must be one of
isOneOf,isNotOneOf,contains,doesNotContain,startsWith,endsWith,matchesRegex,isEmpty. - Property
Field stringName - The name of the property field
- Property
Field stringType - Value must be one of
attribute,payload,alertField. - Property
Field stringValue - The value of the property field
- Property
Field List<string>Values
- Alert
Urgency []stringIds - The Alert Urgency IDs to check in the condition
- Conditionable
Id string - The ID of the conditionable
- Conditionable
Type string - The type of the conditionable. Value must be one of
AlertField. - Property
Field stringCondition Type - Value must be one of
isOneOf,isNotOneOf,contains,doesNotContain,startsWith,endsWith,matchesRegex,isEmpty. - Property
Field stringName - The name of the property field
- Property
Field stringType - Value must be one of
attribute,payload,alertField. - Property
Field stringValue - The value of the property field
- Property
Field []stringValues
- alert
Urgency List<String>Ids - The Alert Urgency IDs to check in the condition
- conditionable
Id String - The ID of the conditionable
- conditionable
Type String - The type of the conditionable. Value must be one of
AlertField. - property
Field StringCondition Type - Value must be one of
isOneOf,isNotOneOf,contains,doesNotContain,startsWith,endsWith,matchesRegex,isEmpty. - property
Field StringName - The name of the property field
- property
Field StringType - Value must be one of
attribute,payload,alertField. - property
Field StringValue - The value of the property field
- property
Field List<String>Values
- alert
Urgency string[]Ids - The Alert Urgency IDs to check in the condition
- conditionable
Id string - The ID of the conditionable
- conditionable
Type string - The type of the conditionable. Value must be one of
AlertField. - property
Field stringCondition Type - Value must be one of
isOneOf,isNotOneOf,contains,doesNotContain,startsWith,endsWith,matchesRegex,isEmpty. - property
Field stringName - The name of the property field
- property
Field stringType - Value must be one of
attribute,payload,alertField. - property
Field stringValue - The value of the property field
- property
Field string[]Values
- alert_
urgency_ Sequence[str]ids - 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_ strcondition_ type - Value must be one of
isOneOf,isNotOneOf,contains,doesNotContain,startsWith,endsWith,matchesRegex,isEmpty. - property_
field_ strname - The name of the property field
- property_
field_ strtype - Value must be one of
attribute,payload,alertField. - property_
field_ strvalue - The value of the property field
- property_
field_ Sequence[str]values
- alert
Urgency List<String>Ids - The Alert Urgency IDs to check in the condition
- conditionable
Id String - The ID of the conditionable
- conditionable
Type String - The type of the conditionable. Value must be one of
AlertField. - property
Field StringCondition Type - Value must be one of
isOneOf,isNotOneOf,contains,doesNotContain,startsWith,endsWith,matchesRegex,isEmpty. - property
Field StringName - The name of the property field
- property
Field StringType - Value must be one of
attribute,payload,alertField. - property
Field StringValue - The value of the property field
- property
Field List<String>Values
AlertRouteRuleDestination, AlertRouteRuleDestinationArgs
- Target
Id string - The ID of the target
- Target
Type string - The type of the target. Value must be one of
Service,Group,EscalationPolicy.
- Target
Id string - The ID of the target
- Target
Type string - The type of the target. Value must be one of
Service,Group,EscalationPolicy.
- target
Id String - The ID of the target
- target
Type String - The type of the target. Value must be one of
Service,Group,EscalationPolicy.
- target
Id string - The ID of the target
- target
Type 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.
- target
Id String - The ID of the target
- target
Type 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
rootlyTerraform Provider.
published on Thursday, May 7, 2026 by rootlyhq
