Skip to main content

Command: get

The terraform get command is used to download and update modules mentioned in the root module.

Usage

terraform get [options]
This recursively downloads all modules needed for the configuration in the current working directory, such as modules imported by modules imported by the root module, and so on. If a module is already downloaded, it will not be redownloaded or checked for updates unless the -update flag is specified.
Module installation also happens automatically by default as part of the terraform init command, so you should rarely need to run this command separately.

Options

  • -update - Check already-downloaded modules for available updates and install the newest versions available.
  • -no-color - Disable text coloring in the output.
  • -test-directory=path - Set the Terraform test directory. Defaults to "tests".

Module Installation

The modules are installed into a .terraform/modules directory in the current working directory. This directory should not be committed to version control.

Example

Download all modules referenced in the configuration:
terraform get
Update all previously-downloaded modules:
terraform get -update

Build docs developers (and LLMs) love