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)

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