Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yashmehrotra/jinja2-gcp-secret-manager
Jinja2 extension for fetching secrets GCP Secret Manager
https://github.com/yashmehrotra/jinja2-gcp-secret-manager
gcp google-cloud-platform google-secret-manager jinja jinja2 jinja2-extension secret-management
Last synced: about 1 month ago
JSON representation
Jinja2 extension for fetching secrets GCP Secret Manager
- Host: GitHub
- URL: https://github.com/yashmehrotra/jinja2-gcp-secret-manager
- Owner: yashmehrotra
- License: apache-2.0
- Created: 2020-10-01T11:21:04.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-30T14:02:27.000Z (over 2 years ago)
- Last Synced: 2024-10-12T22:32:19.072Z (2 months ago)
- Topics: gcp, google-cloud-platform, google-secret-manager, jinja, jinja2, jinja2-extension, secret-management
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jinja2-gcp-secret-manager
Jinja2 extension for fetching secrets GCP Secret Manager
## Install
```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" %}
```## 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.