terraform-provider-stackgen

sg_secrets (Data Source)

Lists secrets from the StackGen Vault, with optional filtering by name, category (e.g. cloud, scm, LLM), or subcategory (e.g. aws, github, openai). Only summaries without credential values are returned; descriptive fields such as name and category remain visible.

Example Usage

# Inventory Vault secret descriptions and IDs without retrieving credential values.
# Scope with provider workspace_id (or set org_id on this data source).
data "sg_secrets" "github" {
  category    = "scm"
  subcategory = "github"
}

output "github_secret_ids" {
  value = [for secret in data.sg_secrets.github.secrets : secret.id]
}

Operational notes

This list contains only descriptive secret fields (name, category, description, IDs), not the credential-value metadata map. Descriptions are visible in outputs and state: never store credentials there. Importing sg_secret separately may put credentials into state; secure state and plans.

Schema

Optional

Read-Only

Nested Schema for secrets

Read-Only: