Skip to main content

Provider & Resources

Reference for the provider block and every resource the Webhookr provider manages.

Provider block

terraform {
required_providers {
webhookr = {
source = "forgers-tech/webhookr"
}
}
}

provider "webhookr" {
api_url = "https://api.webhookr.tech"
}
ArgumentRequiredDescription
api_urlYesWebhookr API base URL. Env: WEBHOOKR_API_URL.
api_tokenConditionalAPI token (whk_…). Env: WEBHOOKR_API_TOKEN. Mutually exclusive with Firebase.
firebase_api_keyConditionalFirebase Web API key. Env: WEBHOOKR_FIREBASE_API_KEY.
service_account_emailConditionalService account email. Env: WEBHOOKR_SERVICE_ACCOUNT_EMAIL.
service_account_keyConditionalService account RSA private key (PEM). Env: WEBHOOKR_SERVICE_ACCOUNT_KEY.

See Authentication for how the two auth modes interact.


webhookr_project

Manages a Webhookr project.

resource "webhookr_project" "payments" {
name = "payments-prod"
}

Arguments

ArgumentRequiredDescription
nameYesDisplay name (max 100 characters).

Attributes

AttributeDescription
idUnique identifier of the project.
created_atRFC3339 creation timestamp.
updated_atRFC3339 timestamp of the last update.

webhookr_endpoint

Manages an endpoint within a project.

resource "webhookr_endpoint" "stripe" {
project_id = webhookr_project.payments.id
name = "Stripe events"
is_active = true
}

Arguments

ArgumentRequiredDefaultDescription
project_idYesID of the parent project.
nameYesDisplay name (max 100 characters).
is_activeNotrueWhether the endpoint accepts incoming events.

Attributes

AttributeDescription
idUnique identifier of the endpoint.
slugURL-safe slug generated by the API. Used in the ingest URL: /v1/ingest/<slug>.
created_atRFC3339 creation timestamp.
updated_atRFC3339 timestamp of the last update.
note

slug is computed — the API generates it. You can't set it from Terraform.


webhookr_destination

Manages a delivery target on an endpoint.

resource "webhookr_destination" "orders" {
project_id = webhookr_project.payments.id
endpoint_id = webhookr_endpoint.stripe.id
name = "Order service"
url = "https://orders.internal.example.com/webhooks/stripe"
method = "POST"
content_type = "application/json"
timeout_ms = 30000
is_enabled = true

headers = {
"X-Internal-Token" = "rotate-me"
}
}

Arguments

ArgumentRequiredDefaultDescription
project_idYesID of the parent project.
endpoint_idYesID of the parent endpoint.
nameYesDisplay name (max 100 characters).
urlYesHTTPS URL that receives event deliveries.
methodNoPOSTOne of GET, POST, PUT, PATCH, DELETE.
headersNoMap of custom headers (max 20 entries).
content_typeNoapplication/jsonContent-Type header for deliveries.
timeout_msNo30000Request timeout in ms (100060000).
is_enabledNotrueWhether the destination receives deliveries.

Attributes

AttributeDescription
idUnique identifier of the destination.
created_atRFC3339 creation timestamp.
updated_atRFC3339 timestamp of the last update.

See the complete example to put these together.