Complete the code to call a child module named 'network'.
module "network" { source = [1] }
The source attribute specifies the path to the child module directory. Using "./modules/network" correctly points to the child module folder.
Complete the code to pass a variable 'region' with value 'us-west-1' to the child module.
module "network" { source = "./modules/network" [1] = "us-west-1" }
The variable name must match the input variable defined in the child module. Here, region is the correct variable to pass.
Fix the error in the child module call by completing the missing attribute to output the module's VPC ID.
output "vpc_id" { value = module.network.[1] }
The output attribute must exactly match the output name defined in the child module, which is vpc_id in snake_case.
Fill both blanks to define a child module with source path and pass a variable 'cidr_block'.
module "vpc" { source = [1] [2] = "10.0.0.0/16" }
The source must point to the child module folder "./modules/vpc". The variable name cidr_block matches the expected input variable in the child module.
Fill all three blanks to define a child module, pass variables 'name' and 'environment', and output the module's subnet ID.
module "subnet" { source = [1] name = [2] environment = [3] } output "subnet_id" { value = module.subnet.subnet_id }
The source points to the child module folder "./modules/subnet". The variables name and environment are passed with appropriate string values matching typical naming conventions.