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.
# 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
}
terraform import sg_governance_assignment.example '<governance_version_id>/Organization/<workspace_id>'
governance_version_id (String) UUID of the governance version to assign. Usually sg_governance.example.version_id. Changing forces a new resource.workspace_id (String) UUID of the workspace (organization / sg_project.id) to assign governance to. Changing forces a new resource.enforce_on_contained_appstack_versions (Boolean) When true and owner_type is Organization, enforce governance on appstacks inside the workspace. Defaults to true.owner_type (String) Assignment target type. Defaults to Organization (workspace). Other values: AppStack, AppStackVersion. Changing forces a new resource.id (String) Composite identifier in the format <governance_version_id>/<owner_type>/<workspace_id>.