Skip to main content

Reference Variables

Reference variables are crucial for data transfer and state management within IaC groups, templates, and stack workflows. They allow the seamless utilization of output variables from one element (such as a workflow or template) as input references in subsequent elements, thereby streamlining processes and enhancing system modularity.

Referencing Variables​

Begin by navigating to Org > Workflow Group > Workflow > Stack, and select the desired workflow. In the stack workflow, access the settings tab and locate the referencing section.

To reference a variable, click the gear icon (âš™) next to the input field. This is essential each time a resource needs to:

  • Reference an already created resource.
  • Include a secret from the vault.
  • Use a value from another template.
note

The 'reference builder' is utilized for these purposes. Access it by choosing your workflow, stack, or IaC Group, then go to 'Settings'. In the 'FORM' section, click the settings wheel next to the desired input field.

Reference variables can be implemented in the following methods:

  1. Workflow: Enable the use of output variables from one workflow as inputs in another for seamless data flow.
  2. Secret: Manage and reference sensitive information within workflows securely.
  3. Template: Utilize predefined variables in templates for consistent and efficient workflow integration.
note

The Template type is exclusive to the IaC group, as it allows referencing other templates within the same group, relevant primarily for IaC group constructions.

a) Workflow​

Under the VCS Settings in the workflow's settings tab, click the gear icon (âš™) next to Subnet IDs for Cluster and select Workflow as the reference type.
Choose the Workflow Group Name, Stack Name (optional), and Workflow Name from the provided dropdown menus. Then, specify the Output Key (e.g., public_subnets.value, public_subnets.name). As the final step, click Use.

Reference variable structure:

  • Standard workflow: ${workflow::WFG-Jo.terraform-aws-vpc.outputs.<OUTPUT_KEY>}
  • Workflow with stack: ${workflow::WFG-Jo.EKS-cluster.<WORKFLOW_NAME>.outputs.<OUTPUT_KEY>}

b) Secret​

Similarly, referencing secrets is straightforward. Select any item from your Vault for reference.

Reference variable structure: ${secret::vault_name}

c) Template​

Navigate to Marketplace > Library > IaC Groups and select or create your IAC Group Template. To connect different templates within your IAC group, select a template and proceed as follows:

In the 'Environment Variable' field, click the settings icon and select 'Template' type. Then, choose a template from the dropdown for reference and specify the "Output Key".

Reference variable structure: ${reference::template-group.0.outputs.cluster_name}

Viewing Output Variables​

To review all reference variables in your workflow, go to Orchestrator > Workflow Groups and select the pertinent workflow. Under the "Outputs" tab, locate "Workflow Outputs" to see all reference points for an active workflow. Each point has associated values, which can be copied using the settings icon.