Environment Variables
Introduction
Environment variables are automatically inherited in all applications, services, and databases inside the Environment. These are available at runtime, as well as during builds and deploys.
Environment variables are unique for the entire environment and their values can be overridden only at the component level.
Creating an Environment Variable
To create environment variables, follow the steps below:
1. Click on the project name in the upper-right corner of the Bunnyshell interface.
2. Select View all projects.
3. Select the environment for which you want to add a variable.
4. Click on your environment's
Settings button.
5. On the left-side menu, click Environment variables.
6. Click Create variable.
7. Enter a name and a value and for your variable.
When choosing a name, make sure you take in account the following requirements:
Variable names should use only alphanumeric characters and the underscore character.
Variable names should not begin with a double underscore.
Variable names should not begin with BNS_.
Variable keys should not contain dash “-”.
Variable names cannot contain more than 255 characters.
Variable names cannot contain less than 3 characters.
8. Choose whether your variable should be a secret one or not. Secrets are encrypted and are only accessible during build and runtime.
9. Finally, click the Create variable button.
Editing or Deleting an Environment Variable
1. Go to the Environment variables screen.
2. Click the
Options button corresponding to the variable in question.
3. Choose the desired action: Edit or Delete.
Overriding an Environment Variable
Application variables override environment variables and environment variables override project variables. After being passed to a container, all of these are considered environment variables.
How to override an Environment Variable
1. Access the project where you want to override the variable.
2. Select the environment where the variable will be overridden.
3. Choose the component (application or database) where the variable will be overridden and click its corresponding
Options button. Then select Settings.
4. On the left-side, click on Variables (Applications variables or Database variables, depending on the component selected).
5. Click the Create variable button.
6. To override the Environment Variable, you need to create a new variable with a similar name and a different value. Fill all the fields accordingly, then click Create variable.
Last updated
Was this helpful?
