Skip to main content
Managing workflows in terraform is useful if you:
  • Want to use version control to preview and roll-back changes to a workflow
  • Want to apply complex access control (e.g. only members of the SRE team can edit specific core SRE workflows)
  • Want to create workflows programmatically based on other data that you store in Terraform

Building your Terraform

Workflows have a pretty complex structure, so we’d recommend you build your workflow in the UI using our visual builder, and then copy the Terraform that we generate into your repo. The Copy this workflow to Terraform drawer, showing the generated incident_workflow resource

Making the dashboard ‘Terraform aware’

We want to make sure the dashboard understands that you’re managing a workflow via Terraform, and can adapt accordingly. You can easily see which workflows are managed via Terraform: A workflow list where one row carries a purple Synced label You can tell us where your Terraform code is stored, so it’s easy for your colleagues to find and update it: A banner reading This workflow is managed in Terraform, with a link to the repository We warn you before you make a change that would pull the workflow out of sync with your Terraform state: An Are you sure? dialog asking you to type the workflow name before Disconnect You can find out more in our Terraform provider docs.

API Key Permissions

As part of the setup you’ll need to create an incident.io API Key. To do all the things we currently support in Terraform, you’ll want to look at giving the key the following permissions. However, you can always refine this if you’re only looking to manage certain components. ​ The Create API Key dialog with the workflow and catalog permissions ticked