Pin Terraform version and provider source/version constraints.
Section: Providers
Required providers snippet
hcl
hcl
terraform {
required_version = ">= 1.6.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}Explanation
Pin Terraform version and provider source/version constraints.
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 Providers
Generate provider lock info for platform
Update the dependency lock file with checksums for target platforms.
Mirror providers locally
Download required providers into a local mirror directory.
CLI config provider mirror snippet
Configure provider installation behavior in CLI config file.
README module example pattern
Example of documenting reusable module outputs clearly.
Moved block snippet
Use moved blocks to preserve state during resource renames in configuration.