Environment Variables
Configure environment variable scopes for application builds and runtime containers.
Environment Variables
Configure environment variable scopes for application builds and runtime containers.
This guide covers variable scopes, redeployment requirements, table filters, and variable deletion.
About Environment Variable Scopes
Environment variables are key-value settings injected into your application workloads. monolayer supports production, preview, and specific preview environment scopes.
- Production: Applies to the production branch environment.
- Preview: Applies to preview branch environments.
- Specific Preview Environment: Applies only to one feature branch, such as
feature/billing.
IMPORTANT: Saving an environment variable updates project configuration only. Trigger a new deployment before you expect the change to appear in running containers.
Adding a Variable
To create an environment variable and add a scoped setting for your application, you can use the environment variables page.
Before you start
You must know the key, value, and target scope for the variable.
Steps
- Click Projects in the global sidebar.
- Click your target project.
- Click Settings > Environment Variables in the project sidebar.
- Type the variable name in the Key field.
- Type the variable value in the Value field.
- Select the target scope from the Environment pop-up menu.
- Click Submit.
What happens next
The control plane stores the variable and shows a masked value in the variables table.
Viewing and Managing Stored Variables
To search, filter, reveal, or copy stored variable values, you can use the environment variables table.
Before you start
The project must have at least one stored environment variable.
Steps
- Type a key name in the Search field to filter the table.
- Select a scope from the Environment pop-up menu to filter by scope.
- Click the eye icon in a row to reveal the stored value.
- Click the copy icon next to a revealed value to copy it.
What happens next
The table displays the filtered variables and lets you inspect or copy values when needed.
Deleting a Variable
To delete a variable from project configuration, you can use the environment variables table.
Before you start
You must confirm that the variable is no longer required by the target environment.
Steps
- Locate the variable row in the table.
- Click the trash icon in the actions column.
- Click Delete in the confirmation dialog.
What happens next
The control plane removes the variable from project configuration. Trigger a new deployment to remove it from running containers.