terraform-provider-stackgen

sg_project (Resource)

Manages a StackGen project (workspace / organization). Projects group users and resources together with role-based access control.

Use sg_project_member to assign users and sg_role to create custom roles. Workspace create cannot attach governance in the same API call; use sg_governance_assignment with this project’s id after create.

Example Usage

# Minimal project — name must be unique in the organization (lowercase alphanumeric and hyphens).
resource "sg_project" "example" {
  name        = "my-team-project"
  description = "Project for this team's StackGen resources."
}
# Multiple projects — typical pattern for splitting teams or environments.
resource "sg_project" "platform" {
  name        = "platform"
  description = "Shared platform and SRE workloads."
}

resource "sg_project" "product" {
  name        = "product-engineering"
  description = "Application teams and feature development."
}

Import

Import an existing sg_project using its project UUID:

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

Schema

Required

Read-Only