github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/website/docs/cli/commands/providers/mirror.html.md (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Command: providers mirror"
     4  sidebar_current: "docs-commands-providers-mirror"
     5  description: |-
     6    The `terraform providers mirror` command downloads the providers required
     7    for the current configuration and copies them into a directory in the local
     8    filesystem.
     9  ---
    10  
    11  # Command: terraform providers mirror
    12  
    13  The `terraform providers mirror` command downloads the providers required
    14  for the current configuration and copies them into a directory in the local
    15  filesystem.
    16  
    17  In normal use, `terraform init` will automatically download needed providers
    18  from provider registries as part of initializing the current working directory.
    19  Sometimes Terraform is running in an environment where that isn't possible,
    20  such as on an isolated network without access to the Terraform Registry. In
    21  that case,
    22  [explicit installation method configuration](/docs/cli/config/config-file.html#explicit-installation-method-configuration)
    23  allows you to configure Terraform, when running on a particular system, to
    24  consult only a local filesystem directory where you've created a local mirror
    25  of the necessary plugins, and to skip accessing the upstream registry at all.
    26  
    27  The `terraform providers mirror` command can automatically populate a directory
    28  that will be used as a local filesystem mirror in the provider installation
    29  configuration.
    30  
    31  -> `terraform providers mirror` is available only in Terraform v0.13 or later.
    32  
    33  ## Usage
    34  
    35  Usage: `terraform providers mirror [options] <target-dir>`
    36  
    37  A single target directory is required. Terraform will create under that
    38  directory the path structure that is expected for filesystem-based provider
    39  plugin mirrors, populating it with `.zip` files containing the plugins
    40  themselves.
    41  
    42  Terraform will also generate various `.json` index files which contain suitable
    43  responses to implement
    44  [the network mirror protocol](/docs/internals/provider-network-mirror-protocol.html),
    45  if you upload the resulting directory to a static website host. Terraform
    46  ignores those index files when using the directory as a filesystem mirror,
    47  because the directory entries themselves are authoritative in that case.
    48  
    49  This command supports the following additional option:
    50  
    51  * `-platform=OS_ARCH` - Choose which target platform to build a mirror for.
    52    By default Terraform will obtain plugin packages suitable for the platform
    53    where you run this command. Use this flag multiple times to include packages
    54    for multiple target systems.
    55  
    56    Target platform names consist of an operating system and a CPU
    57    architecture. For example, `linux_amd64` selects the Linux operating system
    58    running on an AMD64 or x86_64 CPU.
    59  
    60  You can run `terraform providers mirror` again on an existing mirror directory
    61  to update it with new packages. For example, you can add packages for a new
    62  target platform by re-running the command with the desired new `-platform=...`
    63  option, and it will place the packages for that new platform without removing
    64  packages you previously downloaded, merging the resulting set of packages
    65  together to update the JSON index files.