Configure environment variables from Google Cloud Secret Manager
inspired by: https://github.com/codingforentrepreneurs/Serverless-Container-Based-Python-App-on-Google-Cloud-Run
You can install the package via pip:
pip install gcloud_secret_configure
from gcloud_secret_configure import get_config, GoogleSecretFetcher
# 'secret_label' must be the label of the uploaded secret
config = get_config(GoogleSecretFetcher(), secret_label="py_env_file")
MODE = config("MODE", cast=str, default="test")
- Your environment is already authenticated to GoogleCloud
- Your secret has already been uploaded.