⚠️ Experimental — Manages a Guild notification channel used by sg_agent_schedule and sg_webhook to deliver run success/failure notifications via email, Slack, or HTTPS webhook.
Channel type is immutable after create. Reference channels by id in notification_channel_ids on schedules and webhooks.
# When to use: Deliver schedule/webhook run success/failure notifications by email.
# Reference the channel id from sg_agent_schedule.notification_channel_ids or
# sg_webhook.notification_channel_ids.
#
# Prerequisites: none beyond org access. Channel type is immutable after create.
#
# Related: sg_agent_schedule, sg_webhook; see resource_slack.tf for Slack delivery.
resource "sg_notification_channel" "email_oncall" {
name = "sre-oncall-email"
type = "email"
enabled = true
emails = [
"sre-oncall@example.com",
"platform-alerts@example.com",
]
}
# Slack notification channel — routes run notifications into the owner default
# Slack scope (or a custom event_scope when set). Pair with sg_guild_platform
# Slack credentials so delivery can reach the workspace.
resource "sg_notification_channel" "slack_ops" {
name = "ops-slack"
type = "slack"
enabled = true
event_scope = "" # empty = owner default Slack scope
}
Import an existing sg_notification_channel using its notification channel UUID:
terraform import sg_notification_channel.example '123e4567-e89b-12d3-a456-426614174000'
name (String) Human-readable channel name, unique within the owner.type (String) Delivery type: email (recipient list), slack (channel ID), or webhook (HTTPS URL). Immutable after create.channel_id (String) Slack channel ID (C…) to receive notifications. Required for slack channels; choose from synced Connect Slack channels.channel_name (String) Optional Slack channel display name (without #). Delivery uses channel_id.emails (List of String) Recipient email addresses for email channels. At least one is required when type is email.enabled (Boolean) Whether the channel is active. Defaults to true when omitted.event_scope (String) Deprecated Slack routing scope; ignored for delivery. Use channel_id instead. Empty clears the legacy value.secret (String, Sensitive) Optional webhook Bearer token. Write-only; never returned by Guild. Omitting or setting empty on update keeps the existing remote secret.url (String) HTTPS destination for webhook notifications. Required for webhook channels; private destinations are rejected by Guild.created_at (String) Creation timestamp (RFC 3339).created_by (String) User UUID that created the channel.id (String) Server-assigned notification channel UUID. Import with: terraform import sg_notification_channel.example ‘secret_set (Boolean) Whether Guild has a webhook Bearer token stored. The token itself is never returned.updated_at (String) Last modification timestamp (RFC 3339).updated_by (String) User UUID that last modified the channel.