Use a Terraform Registry module with a version constraint.
Section: Modules
Module source registry snippet
hcl
hcl
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "~> 5.0"
}Explanation
Use a Terraform Registry module with a version constraint.
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 Git snippet
Use a module source from Git with a specific ref.
Init from module source
Copy a module into an empty working directory and initialize it.
README module example pattern
Example of documenting reusable module outputs clearly.
Version variables pattern
Example of typed input variables for reusable modules.
Generate provider lock info for platform
Update the dependency lock file with checksums for target platforms.