You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/datasources.md
+41Lines changed: 41 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,7 @@ Gomplate supports a number of datasources, each specified with a particular URL
63
63
|[File](#using-file-datasources)|`file`| Files can be read in any of the [supported formats](#mime-types), including by piping through standard input (`Stdin`). [Directories](#directory-datasources) are also supported. |
64
64
|[Git](#using-git-datasources)|`git`, `git+file`, `git+http`, `git+https`, `git+ssh`| Files can be read from a local or remote git repository, at specific branches or tags. [Directory semantics](#directory-datasources) are also supported. |
65
65
|[GCP Compute Instance Metadata](#using-gcpmeta-datasources)|`gcp+meta`| Provides access to the [GCP VM Metadata Service][], including instance and project metadata. |
66
+
|[GCP Secret Manager](#using-gcpsm-datasources)|`gcp+sm`|[GCP Secret Manager][] stores named secrets; each read returns one secret’s latest payload (often text or JSON). |
66
67
|[Google Cloud Storage](#using-google-cloud-storage-gs-datasources)|`gs`|[Google Cloud Storage][] is the object storage service available on GCP, comparable to AWS S3. |
67
68
|[HTTP](#using-http-datasources)|`http`, `https`| Data can be sourced from HTTP/HTTPS sites in many different formats. Arbitrary HTTP headers can be set with the [`--datasource-header`/`-H`][] flag |
68
69
|[Merged Datasources](#using-merge-datasources)|`merge`| Merge two or more datasources together to produce the final value - useful for resolving defaults. Uses [`coll.Merge`][] for merging. |
The `gcp+sm://` scheme provides access to [GCP Secret Manager][]. Each secret holds a payload (commonly a string or JSON document). Accessing a datasource reads the **latest** enabled version of that secret.
634
+
635
+
### URL Considerations
636
+
637
+
The _scheme_ and _path_ URL components are used by this datasource.
638
+
639
+
- the _scheme_ must be `gcp+sm`
640
+
- the _path_ must identify the secret using Secret Manager’s resource form: `projects/PROJECT_ID/secrets/SECRET_ID` (for example `gcp+sm:///projects/my-project/secrets/my-secret`)
641
+
642
+
[Directory](#directory-datasources) semantics are not supported.
643
+
644
+
### Authentication
645
+
646
+
The Secret Manager client uses [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials) (for example `gcloud auth application-default login`, a service account key via `GOOGLE_APPLICATION_CREDENTIALS`, or credentials from the metadata server on GCE, GKE, or Cloud Run).
647
+
648
+
See Google Cloud’s [authentication overview](https://docs.cloud.google.com/docs/authentication/getting-started) for details.
649
+
650
+
### Output
651
+
652
+
The output will be the secret payload, parsed based on the discovered [MIME type](#mime-types).
653
+
654
+
### Examples
655
+
656
+
Given a secret `my-secret` in project `my-project` whose payload is JSON `{"foo":"bar","baz":"qux"}`:
0 commit comments