Complete the code to define the root module source.
module "network" { source = "[1]" }
The root module uses a relative path to include local modules. Here, ./modules/network points to the network module folder.
Complete the code to declare a variable in the root module.
variable "region" { type = string default = "[1]" }
The default value for the region variable is a valid AWS region string like us-east-1.
Fix the error in the root module output block.
output "vpc_id" { value = module.network.[1] }
Outputs must match the exact attribute name exposed by the module. Usually, Terraform uses snake_case like vpc_id.
Fill both blanks to correctly pass a variable from the root module to a child module.
module "compute" { source = "./modules/compute" [1] = var.[2] }
The root module passes its variable var.region to the child module's region input.
Fill all three blanks to define an output in the root module that references a child module's output.
output "[1]" { value = module.compute.[2] description = "[3]" }
The output name and value must match the child module's output. The description explains the output clearly.