mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Signed-off-by: Christian Mesh <christianmesh1@gmail.com> Signed-off-by: ollevche <ollevche@gmail.com> Co-authored-by: ollevche <ollevche@gmail.com>
49 lines
2.0 KiB
Plaintext
49 lines
2.0 KiB
Plaintext
---
|
|
description: The tofu get command downloads and updates modules.
|
|
---
|
|
|
|
# Command: get
|
|
|
|
The `tofu get` command is used to download and update
|
|
[modules](../../language/modules/develop/index.mdx) mentioned in the root module.
|
|
|
|
## Usage
|
|
|
|
Usage: `tofu get [options]`
|
|
|
|
The modules are downloaded into a `.terraform` subdirectory of the current
|
|
working directory. Don't commit this directory to your version control
|
|
repository.
|
|
|
|
:::note
|
|
Use of [variables in module sources](../../language/modules/sources.mdx#support-for-variable-and-local-evaluation)
|
|
requires [assigning values to root module variables](../../language/values/variables.mdx#assigning-values-to-root-module-variables)
|
|
when running `tofu get`.
|
|
:::
|
|
|
|
The `get` command supports the following option:
|
|
|
|
* `-update` - If specified, modules that are already downloaded will be
|
|
checked for updates and the updates will be downloaded if present.
|
|
|
|
* `-no-color` - Disable text coloring in the output.
|
|
|
|
* `-json` Produce output in a machine-readable JSON format, suitable for use
|
|
in text editor integrations and other automated systems. Always disables color.
|
|
|
|
* `-var 'NAME=VALUE'` - Sets a value for a single
|
|
[input variable](../../language/values/variables.mdx) declared in the
|
|
root module of the configuration. Use this option multiple times to set
|
|
more than one variable. Refer to
|
|
[Input Variables on the Command Line](plan.mdx#input-variables-on-the-command-line) for more information.
|
|
|
|
* `-var-file=FILENAME` - Sets values for potentially many
|
|
[input variables](../../language/values/variables.mdx) declared in the
|
|
root module of the configuration, using definitions from a
|
|
["tfvars" file](../../language/values/variables.mdx#variable-definitions-tfvars-files).
|
|
Use this option multiple times to include values from more than one file.
|
|
|
|
There are several other ways to set values for input variables in the root
|
|
module, aside from the `-var` and `-var-file` options. Refer to
|
|
[Assigning Values to Root Module Variables](../../language/values/variables.mdx#assigning-values-to-root-module-variables) for more information.
|