Skip to main content

Overview

The Rootly Terraform provider lets you manage your entire Rootly configuration as code — severities, services, workflows, on-call schedules, escalation policies, form fields, alert routes, and more. With over 200 resources and 59 data sources, virtually every Rootly configuration object can be declared, versioned, and reviewed through your existing IaC pipeline.
  • Provider: rootlyhq/rootly on the Terraform Registry
  • Current version: 5.10.0
  • Minimum Terraform version: 1.0
  • Downloads: 1.1M+

Authentication

The provider authenticates using a Rootly API token. Generate one from Account > API Tokens in your Rootly dashboard. You can supply credentials via the provider block or environment variables. The environment variable approach is recommended to avoid committing secrets. Environment variables (recommended):
export ROOTLY_API_TOKEN="your-api-token"
export ROOTLY_API_URL="https://api.rootly.com"  # optional, defaults to https://api.rootly.com
Provider block:
provider "rootly" {
  api_token = var.rootly_api_token  # or set ROOTLY_API_TOKEN env var
  api_host  = "https://api.rootly.com"  # optional
}
ParameterEnv varRequiredDefault
api_tokenROOTLY_API_TOKENYes (if env var not set)
api_hostROOTLY_API_URLNohttps://api.rootly.com

Installation

Declare the provider in your Terraform configuration and run terraform init:
terraform {
  required_providers {
    rootly = {
      source  = "rootlyhq/rootly"
      version = "~> 5.10"
    }
  }
}

provider "rootly" {
  # Uses ROOTLY_API_TOKEN env var by default
}

Supported Resources

The provider covers 200+ resources across all major Rootly configuration areas.
Manage the building blocks of incident response and on-call operations.
ResourceDescription
rootly_severityIncident severity levels
rootly_incident_typeIncident types
rootly_incident_roleIncident roles and task assignments
rootly_incident_sub_statusCustom sub-statuses
rootly_incident_permission_setPermission sets for incident fields
rootly_causeIncident causes
rootly_environmentEnvironments
rootly_on_call_roleOn-call roles
rootly_scheduleOn-call schedules
rootly_schedule_rotationSchedule rotations
rootly_schedule_rotation_active_dayActive days within rotations
rootly_schedule_rotation_userUsers assigned to rotations
rootly_on_call_shadowShadow assignments for learning
rootly_override_shiftSchedule override shifts
rootly_escalation_policyEscalation policies
rootly_escalation_levelEscalation levels within a policy
rootly_escalation_pathEscalation paths
rootly_teamTeams
Configure alert routing, sources, urgencies, and grouping rules.
ResourceDescription
rootly_alerts_sourceAlert sources (inbound integrations)
rootly_alert_routeAlert routing rules
rootly_alert_routing_ruleConditions within an alert route
rootly_alert_groupAlert grouping configuration
rootly_alert_urgencyAlert urgency levels
rootly_alert_fieldCustom alert fields
rootly_heartbeatHeartbeat monitors
Automate incident response with workflows triggered by incidents, alerts, pulses, and more.
ResourceDescription
rootly_workflow_incidentWorkflows triggered by incident events
rootly_workflow_alertWorkflows triggered by alert events
rootly_workflow_pulseWorkflows triggered by pulses
rootly_workflow_post_mortemWorkflows triggered by post-mortem events
rootly_workflow_simpleSimple scheduled or manual workflows
rootly_workflow_groupWorkflow groups for organization
rootly_workflow_action_itemAction item automation within workflows
rootly_workflow_custom_field_selectionCustom field conditions on workflows
rootly_workflow_form_field_conditionForm field conditions on workflows
132 workflow task types are available as individual resources, covering integrations with Slack, Jira, PagerDuty, Datadog, GitHub, Notion, and many more. See the full resource list in the Terraform Registry.
Manage your service catalog, functionalities, and custom catalog entities.
ResourceDescription
rootly_serviceServices in your catalog
rootly_functionalityFunctionalities
rootly_catalogCustom catalogs
rootly_catalog_entityEntities within a catalog
rootly_catalog_propertyProperties on catalog entities
rootly_catalog_checklist_templateChecklist templates for catalog entities
Declare form fields, options, and placement rules for incident forms.
ResourceDescription
rootly_form_fieldCustom form fields
rootly_form_field_optionOptions for multi-select and dropdown fields
rootly_form_field_placementField placement on incident forms
rootly_form_field_placement_conditionConditions controlling field visibility
rootly_form_field_positionField ordering within a form
rootly_form_setSets of form fields
rootly_form_set_conditionConditions for form set activation
rootly_custom_fieldAdditional custom fields
rootly_custom_field_optionOptions for custom fields
rootly_custom_formCustom form configurations
Manage retrospective templates and processes.
ResourceDescription
rootly_post_mortem_templatePost-mortem document templates
rootly_retrospective_configurationRetrospective configuration
rootly_retrospective_processRetrospective process definitions
rootly_retrospective_process_groupProcess groups
rootly_retrospective_process_group_stepSteps within process groups
rootly_retrospective_stepIndividual retrospective steps
Manage status pages and their templates.
ResourceDescription
rootly_status_pageStatus pages
rootly_status_page_templateStatus page update templates
Manage communication templates, channels, and RBAC roles.
ResourceDescription
rootly_roleRBAC roles
rootly_authorizationRole-based authorizations
rootly_communications_templateCommunication message templates
rootly_communications_typeCommunication types
rootly_communications_stageCommunication stages
rootly_communications_groupCommunication groups
rootly_webhooks_endpointOutbound webhook endpoints
rootly_secretSecrets for use in workflows
rootly_dashboardDashboards
rootly_dashboard_panelDashboard panels
rootly_playbookPlaybooks
rootly_playbook_taskTasks within a playbook
rootly_live_call_routerLive call router configuration

Data Sources

59 data sources let you reference existing Rootly resources in your configuration without managing them through Terraform.
# Look up an existing service
data "rootly_service" "payments" {
  slug = "payments"
}

# Look up an existing team
data "rootly_team" "platform" {
  slug = "platform"
}

# Reference them in a resource
resource "rootly_escalation_policy" "platform" {
  name    = "Platform On-Call"
  team_id = data.rootly_team.platform.id
}
Available data sources include: service, services, team, teams, severity, severities, environment, environments, functionality, functionalities, schedule, user, role, incident, workflow, alert_route, escalation_policy, on_call_role, and more.

Examples

Severities and services

resource "rootly_severity" "sev0" {
  name  = "SEV0"
  color = "#FF0000"
}

resource "rootly_severity" "sev1" {
  name  = "SEV1"
  color = "#FFA500"
}

resource "rootly_service" "payments_prod" {
  name  = "payments-prod"
  color = "#800080"
}

On-call schedule with rotation

resource "rootly_schedule" "platform_oncall" {
  name = "Platform On-Call"
}

resource "rootly_schedule_rotation" "weekly" {
  schedule_id = rootly_schedule.platform_oncall.id
  name        = "Weekly Rotation"
}

resource "rootly_schedule_rotation_user" "alice" {
  schedule_rotation_id = rootly_schedule_rotation.weekly.id
  user_id              = "alice-user-id"
  position             = 0
}

Workflow with Jira task

resource "rootly_workflow_incident" "jira" {
  name        = "Create a Jira Issue"
  description = "Open Jira ticket whenever incident starts"
  trigger_params {
    triggers                  = ["incident_created"]
    incident_condition_kind   = "IS"
    incident_kinds            = ["normal"]
    incident_condition_status = "IS"
    incident_statuses         = ["started"]
  }
  enabled = true
}

resource "rootly_workflow_task_create_jira_issue" "jira" {
  workflow_id = rootly_workflow_incident.jira.id
  task_params {
    title       = "{{ incident.title }}"
    description = "{{ incident.summary }}"
    project_key = "ROOT"
    issue_type = {
      id   = "10001"
      name = "Task"
    }
    status = {
      id   = "10000"
      name = "To Do"
    }
    labels = "{{ incident.environment_slugs | concat: incident.service_slugs | join: \",\" }}"
  }
}

Custom form field

resource "rootly_form_field" "regions_affected" {
  name       = "Regions affected"
  kind       = "custom"
  input_kind = "multi_select"
  shown      = ["web_new_incident_form", "web_update_incident_form"]
  required   = ["web_new_incident_form"]
}

resource "rootly_form_field_option" "us_east" {
  form_field_id = rootly_form_field.regions_affected.id
  value         = "US East"
}

resource "rootly_form_field_option" "eu_west" {
  form_field_id = rootly_form_field.regions_affected.id
  value         = "EU West"
}

Importing Existing Resources

Resources already configured in Rootly can be imported into Terraform state without recreating them:
terraform import rootly_severity.sev0 <severity-id>
terraform import rootly_service.payments_prod <service-id>
terraform import rootly_workflow_incident.jira <workflow-id>
Resource IDs can be found in the Rootly API or in the URL when viewing a resource in the dashboard.
https://mintcdn.com/rootly/Elm2B9K1HrybvGWA/images/integrations/logos/pulumi.svg?fit=max&auto=format&n=Elm2B9K1HrybvGWA&q=85&s=ea1b2c5e0de58bc7e32b6b2c33231094

Pulumi

Manage Rootly resources with Pulumi using JavaScript or TypeScript.

API Reference

Explore the full Rootly REST API that powers the Terraform provider.