Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to use a local module source.
Terraform
module "example" { source = "[1]" }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a registry or git URL instead of a local path.
Forgetting to use quotes around the path.
✗ Incorrect
The source attribute points to a local path when using a local module.
2fill in blank
mediumComplete the code to use a module from the Terraform Registry.
Terraform
module "vpc" { source = "[1]" version = "3.0.0" }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a local path or git URL instead of the registry format.
Including
https:// in the source.✗ Incorrect
The Terraform Registry module source uses the format namespace/module/provider.
3fill in blank
hardFix the error in the git module source URL.
Terraform
module "network" { source = "[1]" }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the
git:: prefix.Using SSH URL without
git:: prefix.✗ Incorrect
Git module sources must start with git:: followed by the HTTPS URL.
4fill in blank
hardFill both blanks to specify a git module with a branch.
Terraform
module "app" { source = "[1]?ref=[2]" }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using incomplete git URLs without
git::.Omitting the
?ref= query parameter.Using tags or versions instead of branch names.
✗ Incorrect
The source uses the git URL with git:: prefix, and ?ref= specifies the branch name.
5fill in blank
hardFill both blanks to define a module from the registry with a specific version.
Terraform
module "db" { source = "[1]" version = "[2]" }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing registry format with local paths.
Using invalid version formats.
✗ Incorrect
The source is the registry module, version specifies the module version.