# atmos terraform generate

Export the Terraform configuration Atmos derives from your stacks. Inspect the generated inputs or
supply them to tools and workflows that need backend, variable, or other configuration files on
disk.

**Backend Configuration**

Learn how to configure Terraform backends for state management in Atmos.

Configuration Reference[Read more](/stacks/components/provision/backend)

## Usage

```shell
atmos terraform generate <subcommand> [options]
```

## Subcommands

## Overview

The `generate` commands help you create Terraform configuration files without running Terraform directly. This is useful for:

- **CI/CD pipelines** - Pre-generate configuration files for review or caching
- **Debugging** - Inspect the generated backend and variable configurations
- **Bulk operations** - Generate files for all components across all stacks

## Examples

### Generate Backend Config

Generate a backend configuration file for a single component:

```shell
atmos terraform generate backend vpc -s dev-us-east-1
```

### Generate All Backends

Generate backend configuration files for all components in all stacks:

```shell
atmos terraform generate backends
```

### Generate Variable File

Generate a `.tfvar.json` file for a component:

```shell
atmos terraform generate varfile vpc -s dev-us-east-1
```

### Generate All Variable Files

Generate variable files for all components in all stacks:

```shell
atmos terraform generate varfiles
```

### Generate Plan File

Generate and convert a Terraform plan to JSON or YAML:

```shell
atmos terraform generate planfile vpc -s dev-us-east-1 --format=json
```

## Common Flags

- **`--stack` / `-s`**
  Atmos stack name (required for single-component commands).
- **`--dry-run`**
  Show what would be generated without writing files.
- **`--process-templates`**
  Enable/disable Go template processing (default: enabled).
- **`--process-functions`**
  Enable/disable YAML function processing (default: enabled).

## See Also

- [Backend Provisioning](/stacks/components/provision/backend) - Configure Terraform backends
- [Stack Configuration](/learn/stacks) - Learn about Atmos stacks
- [`atmos terraform plan`](/cli/commands/terraform/plan) - Run Terraform plan
