Skip to main content

CI Output Variables

The ci.output section configures output variables that are written for use in downstream CI jobs. On GitHub Actions, these are written to $GITHUB_OUTPUT. On GitLab CI, they create dotenv artifacts.

Experimental

Configuration

atmos.yaml
ci:
output:
enabled: true
variables:
- has_changes
- has_additions
- has_destructions
- artifact_key
- plan_summary
ci.output.enabled

Write plan/apply results as key-value pairs for use in downstream jobs.

Default: true

ci.output.variables

List of native CI variables to output. This whitelist controls which built-in variables are written. Terraform outputs (prefixed with output_) are always included regardless of this setting.

Default: All available variables

Available Variables

Plan Variables

VariableTypeDescription
has_changestrue/falseWhether the plan has any changes
has_additionstrue/falseWhether the plan creates resources
has_destructionstrue/falseWhether the plan destroys resources
plan_summarystringHuman-readable plan summary (e.g., "3 to add, 1 to change")
artifact_keystringPlanfile storage key (when storage is configured)

Aggregate Multi-component Plan Variables

Graph-backed multi-component plan runs in CI write aggregate output variables once after all components finish. These variables are available for --all, --components, and --query plan runs.

VariableTypeDescription
has_changestrue/falseWhether any component has changes
has_errorstrue/falseWhether any component failed
exit_code0, 1, or 2Aggregate exit code: 1 for any failure, 2 for changes without failures, 0 for no changes
resources_to_createnumberTotal resources to create across successful changed components
resources_to_changenumberTotal resources to update across successful changed components
resources_to_replacenumberTotal resources to replace across successful changed components
resources_to_destroynumberTotal resources to destroy across successful changed components
components_totalnumberTotal components in the graph run
components_succeedednumberComponents that completed without errors
components_failednumberComponents that failed
components_changednumberSuccessful components with changes
components_no_changesnumberSuccessful components with no changes
components_skippednumberComponents skipped because dependencies failed or were skipped
summaryMarkdownFull aggregate job summary body
commandstringAlways plan for aggregate plan output
stackstringRequested stack, or all when not scoped to one stack
componentstringAlways aggregate for aggregate plan output

Apply/Deploy Variables

VariableTypeDescription
successtrue/falseWhether the operation succeeded
output_*variesAll terraform outputs, prefixed with output_

Terraform Outputs

After a successful apply or deploy, all terraform outputs are exported with the output_ prefix. Nested outputs are flattened using dot notation.

For example, a terraform output vpc_id = "vpc-123" becomes output_vpc_id=vpc-123.

tip

Terraform output_* variables bypass the ci.output.variables whitelist — they are always included when output is enabled.

Usage in GitHub Actions

jobs:
plan:
runs-on: ubuntu-latest
outputs:
has_changes: ${{ steps.plan.outputs.has_changes }}
steps:
- name: Terraform Plan
id: plan
run: atmos terraform plan vpc -s prod

apply:
needs: plan
if: ${{ needs.plan.outputs.has_changes == 'true' }}
runs-on: ubuntu-latest
steps:
- run: atmos terraform deploy vpc -s prod