Skip to main content

atmos terraform console

Use this command to open an interactive Terraform console for an Atmos component in a stack, with all component variables and configuration pre-loaded.

atmos terraform console --help

Usage​

Execute the terraform console command like this:

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

This command opens an interactive console for experimenting with Terraform expressions. You can use it to test interpolations, explore data from providers, and debug complex expressions.

Atmos Behavior

Atmos provides standard setup for this command including automatic terraform init, workspace selection, and variable file generation. The console itself operates as native Terraform.

Examples​

Open Console​

# Open an interactive console
atmos terraform console vpc -s dev

Example Console Usage​

# Once in the console, you can evaluate expressions:
> var.instance_type
"t3.micro"

> length(var.availability_zones)
3

> [for az in var.availability_zones : upper(az)]
["US-EAST-1A", "US-EAST-1B", "US-EAST-1C"]

> exit

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

Show what would be executed without actually running the command.

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

Native Terraform Flags​

This command supports native terraform console flags such as -state to specify state file path, -var to set variables, -var-file to specify variable files.