Use a Secret
Overview
To use secrets in your program, you link the secret value on the Kelvin Platform to an Environment variable in the app.yaml file. Then you can access it like any normal Environment variable in any language.
app.yaml setup
| app.yaml Example |
|---|
| defaults:
system:
environment_vars:
- name: demosecret
value: <% secrets.demosecret %> # notice the secrets prefix
|
Python Example
| Read Secret Variable Python Example |
|---|
| import os
demosecret = os.environ.get("demosecret", "error!")
print(f'Your secret is {demosecret}')
|