Docs/Terraform provider

Terraform provider

The statusharbor/statusharbor provider lets you mint Lighthouses and read their state from Terraform — and the companion deployment modules deploy the agent itself (Helm, Docker or cloud-init).

The provider is pre-1.0. Today it covers Lighthouse lifecycle. Monitor and status-page resources are planned.

Setup

terraform {
  required_providers {
    statusharbor = {
      source = "statusharbor/statusharbor"
    }
  }
}
 
provider "statusharbor" {
  api_token = var.statusharbor_api_token
}
 
variable "statusharbor_api_token" {
  type      = string
  sensitive = true
}

The provider is published to the Status Harbor registry at terraform.statusharbor.io. You don't need to configure the hostname — terraform init resolves it via the statusharbor/statusharbor namespace.

Authentication

The provider needs a team:admin API token. Mint one from the console under Settings → API Tokens. Set it via env:

export STATUSHARBOR_API_TOKEN=...

…or pass it explicitly via the api_token provider attribute.

team:admin tokens authenticate as the user who minted them. If that user is removed from the team the token stops working — see API tokens.

What's in the provider

  • Resource: statusharbor_lighthouse — create / update / delete a Lighthouse.
  • Data source: statusharbor_lighthouse — look up an existing Lighthouse by id. Same attributes minus token.

What's not in the provider yet

  • HTTP / TCP / UDP / SSL / DNS monitors
  • Notification destinations
  • Status pages
  • Team / member management

For these, use the dashboard for now or open an issue on the provider repo to vote on the order.

State & secrets

The Lighthouse token attribute is sensitive and is returned only at create time. It's persisted in your Terraform state going forward. Use a remote state backend with encryption at rest (S3 + KMS, GCS + CMEK, or Terraform Cloud). Local state on a laptop is not appropriate for production.