terraform-provider-stackgen

sg_governance_assignment (Resource)

Assigns a governance version to a workspace (organization).

Create a workspace with sg_project, then attach governance with this resource. The workspace create API cannot set governance in the same call.

Example Usage

# Attach an existing governance version to a newly created workspace.
data "sg_governance" "baseline" {
  name = "default-prod-governance"
}

resource "sg_project" "payments" {
  name        = "team-payments"
  description = "Payments workspace"
}

resource "sg_governance_assignment" "payments" {
  governance_version_id                  = data.sg_governance.baseline.version_id
  workspace_id                           = sg_project.payments.id
  enforce_on_contained_appstack_versions = true
}

Import

terraform import sg_governance_assignment.example '<governance_version_id>/Organization/<workspace_id>'

Schema

Required

Optional

Read-Only