> ## Documentation Index
> Fetch the complete documentation index at: https://docs.incident.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage your account with Terraform

> Manage incident.io configuration as code with our official Terraform provider

We maintain an [official Terraform provider](https://registry.terraform.io/providers/incident-io/incident/latest) for incident.io. With this provider you can manage account configuration such as:

* Custom fields
* Incident severities
* Incident roles
* Incident statuses
* Schedules
* Escalation paths
* Alert sources
* Alert routes
* Incident templates
* Catalog types and entries
* Maintenance windows

This allows you to bring incident.io account configuration into the same code review and approval cycle as you'd use for other key infrastructure and allows syncing information about your infrastructure or organization into incident.io, such as a list of services or teams.

For resources like schedules, escalation paths, workflows, alert sources, and alert routes, you can configure them in the visual editor first and then export the generated Terraform config — so you don't have to write it from scratch.

As an example, this is how you might configure a custom field for affected services:

```hcl theme={null}
provider "incident" {}

resource "incident_custom_field" "impacted_services" {
  name        = "Impacted Services"
  description = "The services that are impacted by this incident."
  field_type  = "multi_select"
}

resource "incident_custom_field_option" "impacted_services" {
  # Load this from your service catalog, config file, or anywhere.
  for_each = toset([
    "Payments Service",
    "API Gateway",
    "Transaction Ledger",
  ])

  custom_field_id = incident_custom_field.impacted_services.id
  value           = each.value
}
```

<Note>
  Whether a field is required and where it appears is no longer configured on the field itself — set that up in
  [incident forms](/admin/incident-forms) in the dashboard.
</Note>

Full documentation on how to use the provider and all its resources can be found in the Terraform registry at [incident-io/incident](https://registry.terraform.io/providers/incident-io/incident/latest). This includes example code and attribute definitions.

<img src="https://mintcdn.com/incidentio-18bb4170/iopR3BNEfSUPs05k/images/help-centre/manage-your-account-with-terraform/screenshot-1.png?fit=max&auto=format&n=iopR3BNEfSUPs05k&q=85&s=5ea661c4d14d6dd82f00de707604ab3f" alt="Example usage for incident custom fields" width="2038" height="888" data-path="images/help-centre/manage-your-account-with-terraform/screenshot-1.png" />

If you need a refresher on how to provision your infrastructure with Terraform, check out Hashicorp's [tutorials and documentation](https://developer.hashicorp.com/terraform/tutorials/aws-get-started/infrastructure-as-code).

### Importing existing resources

If you already have configuration set up in the dashboard, you can bring it under Terraform management without recreating it.

For workflows, schedules, escalation paths, alert sources, and alert routes, the easiest path is exporting from the dashboard (see below), which generates the resource block and the matching `terraform import` command for you. For everything else, or if you prefer to write the configuration yourself:

1. Write a resource block matching your existing configuration
2. Find the resource's ID, from the dashboard URL or [the API](/api-reference/introduction)
3. Import it into your Terraform state:

```bash theme={null}
terraform import incident_schedule.primary 01ABC123DEF456GHI789JKL
```

Or, on Terraform 1.5 and later, use an import block:

```hcl theme={null}
import {
  to = incident_schedule.primary
  id = "01ABC123DEF456GHI789JKL"
}
```

4. Run `terraform plan` and adjust your configuration until the plan shows no changes

Each resource's page in the [registry documentation](https://registry.terraform.io/providers/incident-io/incident/latest) shows its import syntax.

### Editing Terraform-managed resources in the UI

Once a resource is managed by Terraform, it becomes locked in the dashboard — you can't save changes directly. But you can still use the UI to compose changes visually:

1. Open the resource (e.g. a schedule or escalation path) in the dashboard
2. Make your changes in the visual editor
3. Instead of saving, click **Export** to get the updated `.tf` configuration
4. Review and apply via your normal Terraform workflow

This keeps Terraform as the source of truth while letting you use our powerful visual editor to draft changes.
