Skip to main content

atmos terraform output

Use this command to read Terraform output values for an Atmos component in a stack from the state file.

atmos terraform output --help

Usage​

Execute the terraform output command like this:

atmos terraform output <component> -s <stack> [options]

This command reads output values from the Terraform state file and prints them. Output values are useful for passing information between different Terraform configurations or to external systems.

Atmos Behavior

Atmos provides standard setup for this command including automatic terraform init, workspace selection, and variable file generation. The output retrieval itself is handled by native Terraform.

Examples​

Show All Outputs​

# Display all outputs for a component
atmos terraform output vpc -s dev

Get Specific Output​

# Get a specific output value
atmos terraform output vpc -s dev vpc_id

JSON Format​

# Get outputs in JSON format
atmos terraform output vpc -s dev -json

Raw Output​

# Get raw output value (useful for scripts)
atmos terraform output vpc -s dev -raw vpc_id

Arguments​

component (required)

Atmos component name.

Flags​

--stack / -s (required)

Atmos stack name where the component is defined.

--skip-init (optional)

Skip running terraform init before executing the command.

atmos terraform output vpc -s dev --skip-init
--dry-run (optional)

Show what would be executed without actually running the command.

atmos terraform output vpc -s dev --dry-run

Native Terraform Flags​

-json

Output in JSON format.

atmos terraform output vpc -s dev -json
-raw

Output raw string value (for single outputs).

atmos terraform output vpc -s dev -raw vpc_id
-state=PATH

Path to the state file to read.

atmos terraform output vpc -s dev -state=terraform.tfstate