⚠️ Experimental — Manages a Guild app installation’s integration bindings and optional install config for a deployment-catalog application (e.g. sre for StackGen SRE Copilot).
The app must already be installed in the target org before this resource can apply. This resource calls PUT /api/v1/apps/{appName} — the same API the SRE app onboarding flow uses to attach Grafana, Datadog, GitHub, and other integrations.
Set provider workspace_id so bindings land in the same workspace as other Guild resources.
Set bootstrap_discovery = true on the sre app to run POST /app/sre/api/discovery/runs after bindings (same as finishing onboarding in the UI).
# When to use: Bind Guild integrations to an already-installed deployment-catalog
# app (catalog slug "sre" for StackGen SRE Copilot). Use this after the app is
# installed in the org — this resource does NOT install the app.
#
# Prerequisites:
# - Provider workspace_id so bindings land in the correct org
# - App already installed (UI or catalog install flow)
# - Integration names must exist in the org (sg_guild_integration or pre-provisioned)
#
# Related: sg_sre_alert_webhook (alert ingest), data.sg_app / data.sg_apps (lookup),
# sg_guild_integration (create integrations before binding).
#
# Requires provider >= 0.1.26.
resource "sg_app" "sre" {
app_name = "sre"
integrations = [
"example-grafana",
"example-datadog",
"example-slack",
]
config = {
setup_type = "workspace"
}
}
# When to use: Same as resource.tf, but finish SRE onboarding the same way the UI
# "connect stack" flow does — start discovery after bindings so the app learns
# labels, namespaces, and services before the first incident.
#
# Prerequisites: provider workspace_id; catalog slug "sre"; integrations already exist.
# Set discovery_skip_if_exists = true in CI so re-applies do not start duplicate runs.
#
# Requires provider >= 0.1.26.
resource "sg_app" "sre_with_discovery" {
app_name = "sre"
integrations = ["example-grafana", "example-datadog"]
bootstrap_discovery = true
discovery_skip_if_exists = true
discovery_poll_timeout_seconds = 600
discovery_setup_wait_attempts = 30
}
Import an existing sg_app using its catalog app name:
terraform import sg_app.example 'sre'
Install the catalog app and create the referenced Guild integrations before managing its binding set. integrations replaces the full set on apply. attached_workflows and workflow_assignments are independent: omit either to leave it unmanaged, or set [] to clear it. Assignments must reference app-declared purposes and approved, operator-owned workflows; at most one default per purpose.
app_name (String) Deployment-catalog application slug (e.g. sre for StackGen SRE Copilot). Changing forces replacement.integrations (List of String) Tenant Guild integration names bound to this app install. Replaces the full binding set on each apply.attached_workflows (List of String) Legacy operator-attached Guild workflow names. Omit to leave the legacy set unchanged; an empty list clears it.bootstrap_discovery (Boolean) When true, after binding integrations runs the installed app’s discovery API (SRE Copilot POST /api/discovery/runs) so apply completes the same onboarding step as the UI connect-stack flow. Requires provider workspace_id. Intended for catalog slug sre.config (Map of String) Arbitrary install metadata (e.g. setup_type = workspace). Replaces the previous config when set; omit to leave remote config unchanged on update.discovery_poll_timeout_seconds (Number) Seconds to wait for discovery to reach succeeded or failed when bootstrap_discovery is true.discovery_setup_wait_attempts (Number) Poll GET /api/setup (2s apart) for observability_ready before starting discovery when bootstrap_discovery is true.discovery_skip_if_exists (Boolean) When bootstrap_discovery is true, skip starting discovery if the workspace already has at least one discovery run.enabled (Boolean) Soft-enable or soft-disable this installed app on the rail. Omit to leave visibility unmanaged.workflow_assignments (Attributes List) Purpose-scoped custom Guild workflows. Omit to leave assignments unchanged; an empty list clears all assignments. (see below for nested schema)app_token (String, Sensitive) Secure token for the app to authenticate with the control plane (present when configured).app_version (String) Installed or catalog version.category (String) Application category label from the catalog.configured (Boolean) True when the app is installed and configured for the current owner.description (String) Application description from the catalog.discovery_run_id (String) UUID of the discovery run started by bootstrap_discovery (empty when skipped or bootstrap_discovery is false).discovery_run_status (String) Terminal or in-progress status from the last bootstrap_discovery apply (e.g. succeeded, failed, skipped).display_name (String) Human-readable application name.id (String) Server-assigned installation UUID when configured.installed_at (String) RFC3339 timestamp when the app was installed.mcp_url (String) Streamable HTTP MCP URL when the installed app advertises an MCP endpoint.remote_runners (List of String) Remote runner IDs attached to this app installation.status (String) Installation status when configured.updated_at (String) RFC3339 timestamp of the last configuration update.workflow_purposes (Attributes List) Replaceable workflow purposes declared by this app manifest and their provisioned default workflow names. (see below for nested schema)workflow_assignmentsRequired:
purpose (String) Purpose ID declared in the app workflow_purposes list.workflow_name (String) Approved Guild workflow name replacing this app purpose.Optional:
is_default (Boolean) Select this workflow when a caller omits workflow_name. At most one default per purpose.workflow_purposesRead-Only:
purpose (String) Machine-readable workflow purpose ID declared by the app manifest.workflow_name (String) Provisioned default workflow name for this purpose.