OpsTrailsDocs
Console

Terraform

Track infrastructure changes with the OpsTrails Terraform provider.

Provider Configuration

hcl
terraform {
  required_providers {
    opstrails = {
      source = "opstrails/opstrails"
    }
  }
}

provider "opstrails" {
  api_key = var.opstrails_api_key
}

Track Events

hcl
resource "opstrails_event" "deploy" {
  type    = "deployment"
  source  = "//terraform/my-infra"
  subject = "production"
  version = var.app_version

  data = {
    description = "Terraform apply"
  }
}

Resource Arguments

ArgumentRequiredDescription
typerequiredEvent type
sourceoptionalEvent source URI
subjectoptionalTarget environment
versionoptionalRelease version
dataoptionalArbitrary JSON payload

Events are recorded during terraform apply. The provider uses your API key to authenticate with the OpsTrails API.