# 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.

## Usage

Execute the `terraform state pull` command like this:

```shell
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

```shell
# 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.
  ```shell
  atmos terraform state pull vpc -s dev --dry-run
  ```
- **`--skip-init` (optional)**

  Skip running `terraform init` before executing the command.
  ```shell
  atmos terraform state pull vpc -s dev --skip-init
  ```

## See Also

- [`atmos terraform state`](/cli/commands/terraform/state) - State management overview
- [`atmos terraform state push`](/cli/commands/terraform/state/push) - Update remote state from a local file
- [`atmos terraform state list`](/cli/commands/terraform/state/list) - List resources in the state
