Skip to main content

atmos terraform graph

Use this command to generate a visual dependency graph for an Atmos component's Terraform resources in a specific stack.

atmos terraform graph --help

Usage​

Execute the terraform graph command like this:

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

This command generates a graph of resources in DOT format, which can be converted to an image using Graphviz. This is useful for understanding resource dependencies and the order of operations.

Atmos Behavior

Atmos provides standard setup for this command including automatic terraform init and workspace selection. The graph generation itself is handled by native Terraform.

Examples​

Generate Graph​

# Generate a graph in DOT format
atmos terraform graph vpc -s dev > graph.dot

Generate Plan Graph​

# Generate a graph of planned changes
atmos terraform graph vpc -s dev -type=plan > plan-graph.dot

Convert to Image​

# Convert DOT file to PNG using Graphviz
atmos terraform graph vpc -s dev | dot -Tpng > graph.png

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 graph vpc -s dev --skip-init
--dry-run (optional)

Show what would be executed without actually running the command.

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

Native Terraform Flags​

This command supports native terraform graph flags such as -type to specify graph type (plan, plan-refresh-only, plan-destroy, or apply), -draw-cycles to highlight cycles.