Ignitify.dev
ignitify_hook
Terraform

ignitify_hook

An inbound hook of a task. A POST to its URL, signed with its secret, starts a run of the newest ready deployment of the task. Needs hooks.read and hooks.write (tasks.read to import), and a plan with webhooks.

Example

app.tf
# The hook belongs to the task: a code update keeps its URL and secret.
resource "ignitify_hook" "report" {
  task = ignitify_task.report.slug
}

output "hook_url" {
  value = ignitify_hook.report.url
}

output "hook_secret" {
  value     = ignitify_hook.report.secret
  sensitive = true
}

Arguments and attributes

NameTypeUseMeaning
taskStringRequiredforces replacementThe slug of the task.
urlStringRead-onlyThe URL that triggers the hook.
secretStringRead-onlysensitiveThe key that signs a trigger. The server shows it once, at create. Empty after an import.
created_atStringRead-onlyWhen the hook was created (ISO 8601).
resource_idStringRead-onlyThe server id of the hook. The import id is <task slug>/<resource_id>.

Behaviour

  • The hook belongs to the task. A code update keeps its URL and secret.
  • To rotate the URL and the secret, replace the hook: terraform apply -replace=ignitify_hook.report. The old URL stops working.
  • A sender signs each call with the secret. See Trigger from a webhook.

Import

The import id is <task slug>/<resource_id>. After an import, secret is empty.

terminal
$ terraform import ignitify_hook.report report/<resource_id>