Skip to content

Contexts

A context can be used to define global variables that will be used across different environment templates and resource templates. Config contexts are used in environment or resource templates.

Examples for using Contexts include:

  • Platform team wants to provide the option of spinning up instances only in a couple of regions for the QE team. Platform team creates a Context, specifies the allowed regions as part of Input Variables and sets Override Type as Restricted. This Context can then be attached to an Environment Template. The QE team can select from one of the options (for region) when creating the Environment

  • Platform team can specify the registry endpoint for pulling container images as an Environment Variable using Context

Create a Context

  1. In a project, select Environments > Contexts
  2. Select New Config Context
  3. Enter a name for the context. Optionally, type a description

Context

  1. Select Create

General

The context is created and the General configuration page displays

Setting Description
Name Enter a name for the context
Description Enter a description for the resource. This is optional

Environment Variables

  1. Select Environment variables and Add Environment variable
  2. Enter an environment key and value. See below for more details about environment keys and values
  3. Select Sensitve to obfuscate the information
Setting Description
Environment Key Enter the environment key
Value Enter the value for the environment key
Sensitive Selecting Sensitive will obfuscate the value so it cannot be read after saving the context

Context

File Paths

  1. Select File paths
  2. Select Add File Paths
  3. Enter a name and base64 encoded content for the file path and data respectively. See below for more details about file path configuration
  4. Select Sensitive to obfuscate the information
Setting Description
Name Enter a name for the file path
Data Enter the base64 encoded content
Sensitive Selecting Sensitive will obfuscate the value so it cannot be read after saving the context

Context

Input Variables

  1. Select Variables
  2. Select Add Variable
  3. Enter a name for the variable. Optionally, type a description
  4. Enter the values and select the types for this variable. See below for more details about values and types
Setting Description
Name The name of the variable
Description A brief description of the variable
Value The variable value. This could be
Value Type The type of value
-- HCL Hashicorp configuration language
-- JSON JavaScript Object Notation (JSON) is a lightweight data-interchange format
-- Expressions Expressions are valid units of code that resolve to a value
-- Text Text value
Override Type Controls if a user can change a variable or not
-- Allowed Allows the user to override the value
-- Not Allowed Does not allow the user to override the value
-- Restricted Allows the user to override the value by selecting a different, pre-defined value
Restricted Values If Restricted is selected for the Override Type, enter the values that are allowed
Sensitive Does not display the value in the UI
Required The variable is required when using this Context

Context

Select Save to save the context. Click Cancel to close the configuration and go back to the context list