Docs/Lighthouse Terraform modules

Deployment modules

Three companion modules at github.com/statusharbor/terraform-lighthouse. Each takes the token from a statusharbor_lighthouse resource and deploys the agent.

Pin the source via ?ref=vX.Y.Z. The dashboard install / upgrade modal shows the current latest version.

modules/helm — Kubernetes

Wraps helm_release against the official OCI chart at oci://ghcr.io/statusharbor/charts/lighthouse.

module "lighthouse" {
  source = "github.com/statusharbor/terraform-lighthouse//modules/helm?ref=v0.1.0"
 
  token                 = statusharbor_lighthouse.prod.token
  namespace             = "status-harbor"
  discovery_enabled     = true
  discovery_namespaces  = ["*"]
}
InputDefaultNotes
tokenRequired. From statusharbor_lighthouse.<name>.token.
release_namelighthouse
namespacestatus-harbor
create_namespacetrue
chart_versionlatestPin for deterministic installs.
image_tagchart's appVersionOverride to pin a specific agent build.
discovery_enabledtrueEnable Ingress / Service discovery.
discovery_namespaces["*"]Watched namespaces. * = all.
extra_values{}Map of dotted-path Helm value overrides.
atomictrueRoll back the release on a failed install.
waittrueBlock until pods report ready before returning.
timeout_seconds300Helm timeout for install / upgrade.

The Helm provider must be configured to point at the cluster you're deploying into. The module pins to hashicorp/helm ~> 2.13.

modules/docker — single-host

Wraps docker_container for VMs / bare-metal running Docker.

module "lighthouse" {
  source = "github.com/statusharbor/terraform-lighthouse//modules/docker?ref=v0.1.0"
 
  token     = statusharbor_lighthouse.prod.token
  image_tag = "1.4.0"
  data_dir  = "/var/lib/lighthouse"
}
InputDefaultNotes
tokenRequired.
container_namelighthouse
image_repositoryghcr.io/statusharbor/lighthouse
image_taglatestPin in production.
keep_image_locallytrueKeep the image after terraform destroy for faster re-apply.
data_dirnone (ephemeral)Bind-mount path for the event buffer.
healthcheck_portnoneIf set, enables Docker HEALTHCHECK against /healthz.
extra_env[]Additional KEY=value entries.

modules/cloud-init — VM bootstrap

Emits a shell script you can drop into a cloud VM's user_data (AWS, GCP) or custom_data (Azure). The script downloads the agent and starts it under systemd.

module "lighthouse" {
  source = "github.com/statusharbor/terraform-lighthouse//modules/cloud-init?ref=v0.1.0"
 
  token = statusharbor_lighthouse.prod.token
}
 
resource "aws_instance" "monitor" {
  # ...
  user_data = module.lighthouse.user_data
}
OutputNotes
user_dataSensitive. Shell script with the token baked in.
user_data_base64Sensitive. Base64 form for Azure custom_data.

The token sits in plaintext inside user_data; rely on your provider's at-rest encryption (AWS EBS/EC2 instance metadata, etc.) and avoid committing the rendered output to git.

Versioning

  • Modules are tagged with vX.Y.Z.
  • Minor versions add inputs (backward-compatible). Majors rename or remove things.
  • The dashboard install / upgrade modal pulls the latest module release from GitHub and substitutes it into the ?ref=... for you, so the snippets you copy from there always pin to a known version.