⚠️ Experimental — Registers a StackGen SRE Copilot alert ingest webhook.
This resource calls the SRE app POST /api/v1/alerts/webhook API, which creates a Guild app webhook forwarder to /api/v1/alerts/ingest and stores classify / auto-investigate settings in the SRE app database. sg_webhook alone is insufficient — ingest rejects payloads without the SRE app config row.
Requires provider workspace_id and stackgen_url so requests reach /app/{app_name}/api under the platform base URL.
Import ID format: {app_name}/{source}/{integration} (integration may be empty).
# When to use: Register an SRE Copilot alert-ingest webhook (Datadog, Grafana, …).
# sg_webhook alone is NOT enough — ingest rejects payloads without the SRE app
# config row this resource creates.
#
# Prerequisites:
# - Provider workspace_id + stackgen_url (requests go to /app/{app_name}/api)
# - SRE app installed and integrations bound (sg_app)
# - source must match a registered SRE webhook parser (e.g. datadog, grafana)
#
# Related: sg_app (bind integrations first), sg_webhook (generic Guild webhooks —
# different API; do not substitute for this resource).
#
# Import ID format: {app_name}/{source}/{integration}
# Requires provider >= 0.1.27.
resource "sg_sre_alert_webhook" "datadog" {
app_name = "sre"
source = "datadog"
integration = "example-datadog"
auto_investigate = true
classify_mode = "batch"
classify_batch_window_seconds = 60
classify_bucket_by = "storm_scope"
classify_critical_bypass = true
}
Import an existing sg_sre_alert_webhook using its app_name/source[/integration]:
terraform import sg_sre_alert_webhook.example 'sre/grafana/example-grafana'
The integration segment is optional: use sre/grafana when none is configured.
source (String) Alert source type (e.g. datadog, grafana). Must match a registered SRE app webhook parser.app_name (String) Deployment-catalog application slug hosting alert ingest (default sre).,default_string:sreauto_investigate (Boolean) When true, newly ingested alerts auto-start a deep-dive investigation.classify_batch_window_seconds (Number) Debounce window in seconds for batch mode (15-300).classify_bucket_by (String) Batch bucket key strategy (storm_scope or service).,default_string:storm_scopeclassify_critical_bypass (Boolean) When true, critical and P1 alerts skip batching.classify_mode (String) How webhook alerts are classified: batch or immediate.,default_string:batchintegration (String) Guild integration instance name this webhook receives payloads for (e.g. datadog-integration). Empty string is the default integration.,default_string:guild_webhook_id (String) Guild webhook UUID (same as id).guild_webhook_url (String, Sensitive) Relative Guild trigger path including apiKey query parameter.id (String) Guild webhook UUID for this alert ingest registration.trigger_url (String, Sensitive) Absolute URL to paste into Datadog/Grafana monitor webhooks (stackgen_url + /guild + guild_webhook_url).