# atmos terraform providers mirror

Use this command to save local copies of all required provider plugins for an Atmos component in a stack.

## Usage

Execute the `terraform providers mirror` command like this:

```shell
atmos terraform providers mirror <component> -s <stack> <target-dir> [options]
```

This command downloads the providers required for the component and saves them to a local directory. This is useful for creating a local mirror for air-gapped environments or reducing external network dependencies.

:::tip
Run `atmos terraform providers mirror --help` to see all the available options
:::

## Examples

```shell
# Mirror providers to a local directory
atmos terraform providers mirror vpc -s dev /path/to/mirror

# Mirror for specific platforms
atmos terraform providers mirror vpc -s dev /path/to/mirror -platform=linux_amd64 -platform=darwin_amd64
```

## Arguments

- **`component` (required)**

  Atmos terraform component.
- **`target-dir` (required)**

  The target directory where provider plugins will be saved.

## Flags

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

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

  Show what would be executed without actually running the command.
  ```shell
  atmos terraform providers mirror vpc -s dev /path/to/mirror --dry-run
  ```
- **`--skip-init` (optional)**

  Skip running `terraform init` before executing the command.
  ```shell
  atmos terraform providers mirror vpc -s dev /path/to/mirror --skip-init
  ```

## Native Terraform Flags

The `atmos terraform providers mirror` command supports native `terraform providers mirror` flags. Pass them directly or use `--` to separate Atmos flags from Terraform flags.

- **`-platform=OS_ARCH`**

  Target platform for provider packages. Can be specified multiple times to mirror for multiple platforms.
  ```shell
  atmos terraform providers mirror vpc -s dev /path/to/mirror -platform=linux_amd64 -platform=darwin_amd64
  ```

## See Also

- [`atmos terraform providers`](/cli/commands/terraform/providers) - Show provider requirements
- [`atmos terraform providers lock`](/cli/commands/terraform/providers/lock) - Write out dependency locks
- [`atmos terraform init`](/cli/commands/terraform/init) - Initialize working directory
