-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switch to google.auth.default for auth (#1)
* Allow project to be specified in tag
- Loading branch information
Showing
3 changed files
with
30 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,30 @@ | ||
# jinja2-gcp-secret-manager | ||
|
||
Jinja2 extension for fetching secrets GCP Secret Manager | ||
|
||
# Install | ||
## Install | ||
|
||
```console | ||
```sh | ||
pip install jinja2-gcp-secret-manager | ||
``` | ||
|
||
## Usage | ||
|
||
``` | ||
```jinja2 | ||
# template.j2 | ||
Secret is {% gcp_secret "secret-name" %} | ||
# By default, the latest version is fetched, for specific version use: | ||
2nd version of secret is {% gcp_secret "secret-name" version=2 %} | ||
# If you are using Application default credentials or want to explicitly specify | ||
the project where the secrets should be found, add the `project` term: | ||
3rd version of secret is {% gcp_secret "secret-name" version=2 project="abc123" %} | ||
``` | ||
|
||
Note: Make sure `GOOGLE_APPLICATION_CREDENTIALS` environment variable is set to the correct file path. | ||
## GCP Setup | ||
|
||
For this to work, make sure you either setup the `GOOGLE_APPLICATION_CREDENTIALS` environment variable set to the correct file path or use Application default credentials. See [https://google-auth.readthedocs.io/en/latest/user-guide.html](https://google-auth.readthedocs.io/en/latest/user-guide.html) for more details. | ||
|
||
Note: If you use Application default credentials, you will need to specify project in all `gcp_secret` tags as default project cannot be determined as it can with a service account. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters