# atmos terraform generate backend

Use this command to generate a Terraform backend configuration file for an Atmos [component](/components) in a [stack](/stacks).

## Usage

Execute the `terraform generate backend` command like this:

```shell
atmos terraform generate backend <component> -s <stack>
```

This command generates a backend config file for an Atmos terraform component in a stack.

:::tip
Run `atmos terraform generate backend --help` to see all the available options
:::

## Examples

```shell
atmos terraform generate backend top-level-component1 -s tenant1-ue2-dev
atmos terraform generate backend infra/vpc -s tenant1-ue2-staging
atmos terraform generate backend test/test-component -s tenant1-ue2-dev
atmos terraform generate backend test/test-component-override-2 -s tenant2-ue2-prod
```

## Arguments

- **`component` (required)**

  Atmos terraform component.

## Flags

- **`--stack` (alias `-s`) (required)**

  Atmos stack.
- **`--dry-run` (optional)**

  Dry run.
  ```shell
  atmos terraform generate backend <component> -s <stack> --dry-run=true
  ```
- **`--process-templates` (optional)**

  Enable/disable Go template processing in Atmos stack manifests when executing terraform commands.

  If the flag is not passed, template processing is enabled by default.
  ```shell
  atmos terraform generate backend <component> -s <stack> --process-templates=false
  ```
- **`--process-functions` (optional)**

  Enable/disable YAML functions processing in Atmos stack manifestswhen executing terraform commands.

  If the flag is not passed, YAML function processing is enabled by default.
  ```shell
  atmos terraform generate backend <component> -s <stack> --process-functions=false
  ```
- **`--skip` (optional)**

  Skip processing a specific Atmos YAML function in Atmos stacks manifests when executing terraform commands.

  To specify more than one function, use multiple `--skip` flags, or separate the functions with a comma.
  ```shell
  atmos terraform generate backend <component> -s <stack> --skip=eval --skip=include
  atmos terraform generate backend <component> -s <stack> --skip=terraform.output,include
  ```

:::info
Refer to [Terraform backend configuration](https://developer.hashicorp.com/terraform/language/settings/backends/configuration) for more details
on `terraform` backends and supported formats
:::
