Infrastructure
HCP Terraform Webhooks
Infrastructure as code platform by HashiCorp. Receive events for runs, plan/apply status, and workspace changes.
Connecting HCP Terraform to Hookbase
Create a source in Hookbase first — it gives you an ingest URL to paste into HCP Terraform. Then:
- 1In HCP Terraform, open the workspace and go to Settings → Notifications (or the project's Settings → Notifications to cover every workspace in it)
- 2Click "Create a Notification" and choose the Webhook (generic payload) destination; Slack, Microsoft Teams and Email notifications are not signed
- 3Name it and paste your Hookbase ingest URL as the Webhook URL
- 4Paste the Token Hookbase generated for this source into the Token field. Copy it now: HCP Terraform can't show it after you save
- 5Choose the triggers (e.g. created, needs attention, completed, errored, plus any drift or health triggers) and click "Create a notification"
Signature verification
Set the source's provider to terraform-cloud and paste the signing secret. Every request is checked before the event is stored, and anything that fails is rejected rather than quietly recorded.
- Algorithm
- HMAC-SHA512
- Header
- X-TFE-Notification-Signature
- Where to find the secret
- HCP Terraform → Workspace (or Project) → Settings → Notifications → Create a Notification → Token. Only generic webhook payloads are signed; Slack, Microsoft Teams and Email notifications are not.
HCP Terraform event types
11 of the events people route most often. Hookbase accepts every event HCP Terraform sends, whether or not it is listed here.
run:created
A run was created
run:planning
A run started planning
run:needs_attention
A run needs confirmation to apply
run:applying
A run is applying changes
run:completed
A run completed successfully
run:errored
A run encountered an error
assessment:drifted
Health assessment: drift was detected
assessment:check_failure
Health assessment: a continuous-validation check failed
assessment:failed
Health assessment: the assessment itself errored
workspace:auto_destroy_reminder
Reminder that an automatic destroy run is scheduled
workspace:auto_destroy_run_results
An automatic destroy run finished (payload trigger reads workspace:auto_destroy_results)
What a HCP Terraform webhook looks like
A run:completed payload. Hookbase stores the raw body exactly as it arrived, so this is also what you get back on a replay.
{
"payload_version": 1,
"notification_configuration_id": "nc-abc123",
"run_url": "https://app.terraform.io/app/org/workspaces/infra/runs/run-def456",
"run_id": "run-def456",
"run_message": "Queued via API",
"run_created_at": "2024-01-15T10:20:00.000Z",
"run_created_by": "dev@example.com",
"workspace_id": "ws-ghi789",
"workspace_name": "production-infra",
"organization_name": "my-org",
"notifications": [
{
"message": "Run completed successfully",
"trigger": "run:completed",
"run_status": "applied",
"run_updated_at": "2024-01-15T10:30:00.000Z"
}
]
}Start receiving HCP Terraform webhooks
Create a source, paste the URL into HCP Terraform, and watch the first event arrive. The free tier includes 1,000 events a month.
Get Started Free