Variable Management

Variable Management

The Code Pipes UI provides a convenient variable management panel that offers the following capabilities:

  • Identification and comparison of variables and their values across different environments and applications.
  • Direct editing, management, and deletion of variables from the variable management panel.

Key Concepts

Project-based Variable Management

The variable management panel operates on a project-based level, meaning it displays variables specific to the selected project.

Within a project, the variable management panel organizes variables into the following categories:

  • Project: Variables defined at the project level.
  • Environment: Variables specific to each environment within the project.
  • Application: Variables specific to each application within the project.

Variable Types

There are two types of variables supported in Code Pipes:

  1. Environment Variables: These variables are associated with a particular environment in the project.
  2. Terraform Variables: These variables are used in the Terraform configuration for deploying applications.

Variable Inheritance and Overrides

Code Pipes follows a hierarchical structure, where a project acts as the parent, and environments and applications are its children.

Child variables inherit values from the parent, except when they are specifically overridden for the child.

In the variable management panel, this means that the inherited variables from the project are not displayed for a particular environment or application unless they have been overridden with different values.

Filters

The variable management panel in Code Pipes includes useful filters for various tasks. Here's how to enable and utilize these filters:

How to use filters

Select a project and click the Variables tab in the Code Pipes UI. The filters are represented by icons at the top of the variable management panel. Simply click the desired filter icon, and the panel will display variables based on that filter's characteristics.

Practical Examples

Identify Variables with Different Values in Environment A vs Environment B

  1. Select a project and click the Variables tab to display the variable management panel.
  2. Near the top of the panel, click the "not-equals" icon (an equals sign "=" with a line crossed through it).
  3. This will show you the variables that have different values in different environments.

Example: Let's say you have a variable called REGION, and it has different values in the dev and production environments. You can use the show values toggle button to display the values for the REGION variable in each environment. By default, values are not shown to keep the display clean, but you can click the "show variables" toggle button on the right to reveal the values.

Identify Variables with the Same Values in Environment A and Environment B

  1. Select a project and click the Variables tab to display the variable management panel.
  2. Near the top of the panel, click the "equals" icon (an equals sign "=").
  3. This will show you the variables that have the same values in different environments.
  4. You can click the show values toggle button to examine the values for each variable.

Identify Missing Variables

  1. Select a project and click the Variables tab to display the variable management panel.
  2. Near the top of the panel, click the "missing" icon (a red "X").
  3. This will display a list of variables where a variable exists in one environment but is missing in another.
  4. If a variable exists in Environment A but not in Environment B, the variable name in Environment A will appear in orange text, indicating a probable error.

View Secret Variables

  1. Select a project and click the Variables tab to display the variable management panel.
  2. Near the top of the panel, click the "lock" icon (a lock symbol).
  3. This will show you the projects, environments, and applications that have "secret" values, such as passwords.
    Note: Code Pipes does not display the actual secret values for security reasons; this filter is only to inform you of their presence.

Edit Variables On the Fly

You have the ability to edit, delete, and add variables and their definitions directly from the variable management panel. Here's how:

  1. At the top of the panel, use the left-hand dropdown menu to select a project, environment, or application.
  2. For example, if you selected a project and want to modify a variable at the project level, click on the variable you wish to edit.
  3. Next to the variable name, you will find icons for adding, editing, or deleting variables. Simply click the respective icon to make the desired changes.

Bulk Add Option Using Scope Field

When adding a variable, you can specify where it should be added by filling in values in the scope field. This allows you to add variables to specific locations such as the project, individual environments, or other scopes.

Inheritance cheatsheet

The variable inheritance follows the sequence: Credentials -> Project -> Environment -> Deployment.

In case of conflicts (when the same variable is defined in multiple entities), the value on the entity on the right side takes precedence over the left.

Refer to the following example with variables defined on each entity:

Project:     { A: 11, B: 12, C: 13, D: 14 }
Environment: { C: 23, D: 24, E: 25, F: 26 }
Deployment:  { B: 32, C: 33, F: 36, G: 37 }
VariableProjectEnvironmentDeploymentFinalComment
A1111Inherited from project
B123232Overridden at deployment after inheriting from project
C13233333Overridden at deployment after inheriting from environment and project
D142424Overridden at environment after inheriting from project
E2525Inherited from environment
F263636Overridden at deployment after inheriting from environment
G3737Defined at deployment