# 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 <img src="https://1816776994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlP4CN7wxbqd_3NdM99%2Fuploads%2FzJhu9ZnwAEIrHzs149FM%2Fsettings.png?alt=media&#x26;token=92c48c2e-2474-46da-b7a7-8d2ff81a88a3" alt="" data-size="line"> **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.

{% hint style="info" %}
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.
  {% endhint %}

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**

&#x20;1\. Go to the **Environment variables** screen.

&#x20;2\. Click the <img src="https://1816776994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlP4CN7wxbqd_3NdM99%2Fuploads%2FT0v66K4ibwiGMXN4hXeS%2FOptions.png?alt=media&#x26;token=3524a57e-4fde-4767-8f67-6e008c83769b" alt="" data-size="line"> **Options** button corresponding to the variable in question.

&#x20;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 <img src="https://1816776994-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MlP4CN7wxbqd_3NdM99%2Fuploads%2FT0v66K4ibwiGMXN4hXeS%2FOptions.png?alt=media&#x26;token=3524a57e-4fde-4767-8f67-6e008c83769b" alt="" data-size="line"> **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**.
