terraform get: Usage & Common CI Errors
Download and update the modules a configuration references.
terraform get downloads and installs the child modules referenced in configuration. terraform init does this too (plus providers and backend), so get is mainly for refreshing modules without a full init.
What it does
terraform get installs modules into .terraform/modules based on each module block’s source. With -update it re-fetches modules whose source allows newer versions (git refs, registry version ranges). It does not touch providers or the backend - that is init’s job.
Common usage
# Install modules declared in config
terraform get
# Re-fetch and update modules to newest allowed versions
terraform get -updateCommon error in CI: module not installed
plan/validate fails with "Error: Module not installed - this module is not yet installed. Run \"terraform init\" to install all modules". A bare get can miss this if the backend/providers were never initialized. Fix: in CI run terraform init (which installs modules and providers together) rather than a standalone get. Use terraform get -update only to refresh modules in an already-initialized directory.
Key options
| Option | Purpose |
|---|---|
| -update | Re-fetch modules, updating where allowed |
| -no-color | Disable color |