Terraform Provider: Getting Started
The Terraform provider for StatusPage.me, maintained by the StatusPage.me team, lets you manage status pages, monitors, immutable incidents and timeline updates, maintenance windows, and live metrics as code.
Incident timeline updates and guarded incident archival require provider version 0.1.1 or later.
Requirements
- Terraform CLI
- A StatusPage.me account
- An API key with the scopes required by the resources you manage
The provider is hosted on the public Terraform Registry as hosted-status-page/hsp. It connects only to the hosted StatusPage.me API; there is no self-hosted endpoint to configure.
Create an API key
Create an API key in the API Console. Give it only the scopes your configuration needs:
| Resource | Required scopes |
|---|---|
| Status pages | status-pages:read, status-pages:write |
| Monitors | monitors:read, monitors:write |
| Incidents | incidents:read, incidents:write |
| Maintenance windows | maintenances:read, maintenances:write |
| Metrics | status-pages:read, metrics:write |
Store the key as HSP_API_KEY in your shell or CI secret manager. Do not commit it to a .tf file.
Configure the provider
Create statuspage.tf:
terraform {
required_providers {
hsp = {
source = "hosted-status-page/hsp"
version = "~> 0.1.0"
}
}
}
provider "hsp" {}
Then run:
export HSP_API_KEY=spk_...
terraform init
You can set api_key in the provider block instead, but an environment variable is the safer default for local development and CI.
Create a status page and monitor
resource "hsp_status_page" "app" {
name = "Example Status Page"
slug = "example"
}
resource "hsp_monitor" "website" {
status_page_id = hsp_status_page.app.id
name = "Website"
target = "https://example.com"
}
Review the result before changing your account:
terraform plan
terraform apply