Use a module source from Git with a specific ref.

Section: Modules

Module source Git snippet

hcl
hcl
module "networking" {
  source = "git::https://github.com/acme/networking.git?ref=v1.2.3"
}
Explanation

Use a module source from Git with a specific ref.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Modules
Module source registry snippet
Use a Terraform Registry module with a version constraint.
OpenIn sheethclsame section
Install/update remote modules
Download and update remote module sources.
OpenIn sheetbashsame section
Init from module source
Copy a module into an empty working directory and initialize it.
OpenIn sheetbashsame section
README module example pattern
Example of documenting reusable module outputs clearly.
OpenIn sheethcl2 tag match
Version variables pattern
Example of typed input variables for reusable modules.
OpenIn sheethcl2 tag match
Generate provider lock info for platform
Update the dependency lock file with checksums for target platforms.
OpenIn sheetbash1 tag match