Creates and manages secrets in GCP Secret Manager with automatic versioning.
Config
Outputs
Dependencies
Depends on: Nothing. Depended on by: Resources that need GCP Secret Manager metadata (version tracking, resource naming).Example
Referencing Secrets
gcp/secret outputs GCP metadata (resource_name, version_name, version_id) — not the actual secret value. To inject secret values (like API keys) into other resources, use pragma/secret instead, which outputs its data keys directly as fields:
Notes
- The
project_idandsecret_idfields are immutable — changing them requires deleting and recreating the resource. - Updates to
datacreate a new secret version automatically. - If the secret already exists in GCP, creation is idempotent — it adds a new version to the existing secret.
- Deletion removes the secret and all its versions permanently.