Complete the code to specify the module source version.
module "network" { source = "terraform-aws-modules/vpc/aws" version = "[1]" }
The version attribute specifies the exact module version to use, such as "3.0.0".
Complete the code to pin the module version to a specific release.
module "storage" { source = "terraform-aws-modules/s3-bucket/aws" version = "[1]" }
The ~> 2.5.0 syntax pins the module to versions compatible with 2.5.x, allowing patch updates.
Fix the error in the module version specification.
module "compute" { source = "terraform-aws-modules/ec2-instance/aws" version = [1] }
The version must be a quoted string. Unquoted or using 'latest' without quotes causes errors.
Fill both blanks to specify a module with a version constraint and a source registry.
module "database" { source = "[1]" version = "[2]" }
The source must be the full registry path like terraform-aws-modules/rds/aws, and the version constraint uses ~> for patch updates.
Fill all three blanks to define a module with a Git source and a specific ref version.
module "app" { source = "git::https://github.com/terraform-modules/app.git?ref=[1]" version = "[2]" providers = { aws = [3] } }
The ref in the Git URL pins the module to tag v1.2.3. The version is a string matching the tag without 'v'. The provider alias is aws.default.