Skip to main content

atmos terraform state pull

Use this command to pull the current Terraform state for an Atmos component in a stack and output it to stdout.

atmos terraform state pull --help

Usage

Execute the terraform state pull command like this:

atmos terraform state pull <component> -s <stack> [options]

This command downloads the current state from the remote backend and outputs it as JSON to stdout. This is useful for inspecting state, creating backups, or piping state data to other tools.

tip

Run atmos terraform state pull --help to see all the available options

Examples

# Pull and display state
atmos terraform state pull vpc -s dev

# Save state to a file
atmos terraform state pull vpc -s dev > vpc-state-backup.json

# Pipe state to jq for inspection
atmos terraform state pull vpc -s dev | jq '.resources[] | .type'

Arguments

component (required)

Atmos terraform component.

Flags

--stack (alias -s) (required)

Atmos stack.

--dry-run (optional)

Show what would be executed without actually running the command.

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

Skip running terraform init before executing the command.

atmos terraform state pull vpc -s dev --skip-init

See Also