terraform-provider-stackgen

sg_notification_channel (Resource)

⚠️ 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.

Example Usage

# 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

Import an existing sg_notification_channel using its notification channel UUID:

terraform import sg_notification_channel.example '123e4567-e89b-12d3-a456-426614174000'

Schema

Required

Optional

Read-Only