Creates and manages secrets in GCP Secret Manager with automatic versioning.
Config
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
project_id | string | Yes | — | GCP project ID |
secret_id | string | Yes | — | Secret identifier (unique per project) |
data | string | Yes | — | Secret payload to store |
credentials | dict or string | Yes | — | GCP service account credentials JSON |
Outputs
| Field | Type | Description |
|---|---|---|
resource_name | string | Full GCP resource name (projects/{project}/secrets/{id}) |
version_name | string | Full version resource name including version number |
version_id | string | The version number |
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.