Using Secrets
Access third-party platforms using secure credentials encrypted on Cerebrium
You may want to use API keys, passwords or other sensitive information in your app, but you don’t want them stored in your code. If this is the case, it’s best to make use of Secrets. Secrets are stored encrypted (256-bit Advanced Encryption Standard (AES)) and are only decrypted when your app is run.
Secrets are shared across all apps in your project.
Adding a Secret will make the value available to your app as an environment variable.
Secrets are loaded on container startup. If you update a Secret, it will not take effect until your app container restarts.
Secrets are stored as a string so if your secret is a JSON payload or similar please remember to convert it to the correct format using something such as json.loads(os.environ.get(“MY_JSON_SECRET”)).
Managing Secrets
Secrets are created, updated and deleted in your dashboard.
Secrets are loaded on model start, you will need to wait for your app container to restart, or deploy your app before the new secret is available.
Local Development
When developing locally, you can use an .env
file to store your secrets.
Later the secrets from that file can be added to your project from the dashboard.