For the complete StackGuardian documentation index, see llms.txt. An extended version with full page content is available at llms-full.txt.
Skip to main content

3. Deployment Environment

The Deployment Environment section defines the cloud or platform environment where your workflow will run.

It allows you to connect to specific accounts or environments via Connectors, set environment variables, and link outputs or secrets dynamically across workflows.

This configuration ensures your workflow has the proper credentials and runtime settings to execute tasks on your target infrastructure (e.g., AWS, Azure, GCP, Kubernetes).


3.1 Overview​

This section appears under Settings → Deployment Environment and consists of two main parts:

  1. Connector Selection

  2. Environment Variables Configuration

    overview


3.2 Select Connector​

The Connector represents the cloud or infrastructure integration your workflow uses for deployment.

FieldDescription
Select ConnectorChoose the cloud or infrastructure connector from your organization’s integrations (e.g., AWS, Azure, GCP, VMware, or custom integration) or a connector
Select Child Connector(Optional) Choose a specific account, sub-connector, or environment under the parent connector, such as a specific AWS account or subscription.

connector

When a connector is selected, it’s displayed as:

integrationgroups/<connector-id>

and the connection status is shown (e.g., ✅ Connected or 🔴 Disconnected).

⚙️ The selected connector determines the permissions and APIs accessible to your workflow during execution.

Example: Selecting an AWS connector allows Terraform or Ansible steps to provision or configure AWS resources.


3.3 Environment Variables​

Environment Variables expose custom configuration or runtime data to your workflow environment.

Each variable is defined by a Key and Value, which are passed to the underlying runtime container.

FieldDescription
KeyName of the environment variable (e.g., AWS_REGION, DEPLOYMENT_ENV).
ValueStatic or dynamic value assigned to the variable.
Reference ValueLink this variable to another workflow’s output or a stored secret.
Add Environment Variable +Add multiple variables for flexible configuration.

env

You can add, edit, or delete environment variables at any time.

💡 Example:

  • Key: APP_ENV → Value: production
  • Key: TF_LOG → Value: INFO
  • Key: AWS_DEFAULT_REGION → Value: us-east-1

StackGuardian Environment Variables​

Besides the variables you add here, StackGuardian sets its own variables in every workflow step container, such as SG_WORKFLOW_ID, SG_MOUNTED_ARTIFACTS_DIR and SG_BASE64_WORKFLOW_STEP_INPUT_VARIABLES. For the full list, example values and code samples, see Runtime environment variables.


3.4 Referencing Values​

When setting environment variables, you can choose between manual values or references.

Selecting Reference Value opens the Create Reference dialog, allowing you to link this variable to data from other workflows or secure secrets.

Create Reference Dialog​

FieldDescription
Referencing TypeChoose between: - Workflow Output: Use outputs from previously executed workflows. - Secret: Fetch a stored vault secret (e.g., API key, password).
WorkflowSelect the workflow whose output you want to reference.
Output KeyChoose a specific output key from that workflow.

ref

Once configured, the referenced value will dynamically resolve at runtime.

🔒 This mechanism allows for secure and modular environment setup, without exposing sensitive data directly in your workflow configuration.

Example Use Case:

  • A “Provision Infrastructure” workflow exposes an output vpc_id.
  • A “Deploy Application” workflow references that vpc_id output dynamically using Workflow Output.
  • Secrets such as access tokens or credentials can be securely injected via Secret references from your vault.

For more detailed instructions on creating references, refer to the Reference Variables documentation.


3.5 Referencing StackGuardian Environment Variables​

You can use runtime environment variables in the value of your own variables. For example, set TF_VAR_sg_workflow_id to ${SG_WORKFLOW_ID} to pass the workflow ID into a Terraform or OpenTofu variable. See the Terraform / OpenTofu example.

3.6 Connector Health & Refresh​

When a connector becomes Disconnected, you’ll see a red status indicator.

To fix this:

  • Click the refresh icon (↻) to reconnect the integration.
  • If the issue persists, verify credentials in the organization’s Integrations → Connectors section.

Maintaining healthy connectors ensures smooth execution of workflows and prevents runtime authentication errors.