atmos terraform output
Use this command to read Terraform output values for an Atmos component in a stack from the state file.
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.
Configuration
Configure default behavior for terraform output in your atmos.yaml:
components:
terraform:
# Auto-generate backend configuration
auto_generate_backend_file: true
These settings can also be controlled via environment variables:
export ATMOS_COMPONENTS_TERRAFORM_AUTO_GENERATE_BACKEND_FILE=true
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