0
0
Terraformcloud~20 mins

Module sources (local, registry, git) in Terraform - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Terraform Module Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Identify the correct module source type
Which module source declaration correctly uses a local path in Terraform?
Asource = "git::https://github.com/org/repo.git//modules/network"
Bsource = "registry.terraform.io/modules/network"
Csource = "./modules/network"
Dsource = "terraform-aws-modules/vpc/aws"
Attempts:
2 left
💡 Hint
Local module sources use relative or absolute file paths.
Configuration
intermediate
2:00remaining
Correct Git module source syntax
Which option correctly declares a Terraform module source from a Git repository with a subdirectory path?
Asource = "git::https://github.com/org/repo.git//modules/app"
Bsource = "git@github.com:org/repo.git//modules/app"
Csource = "https://github.com/org/repo.git//modules/app"
Dsource = "git::https://github.com/org/repo.git/modules/app"
Attempts:
2 left
💡 Hint
Git sources require the 'git::' prefix and double slashes before subdirectory.
Architecture
advanced
2:00remaining
Choosing module source for reusable infrastructure
You want to share a Terraform module across multiple projects and teams with version control and easy updates. Which module source type is best?
AHTTP URL to a zip archive
BLocal path on each developer's machine
CTerraform Registry public module
DGit repository with version tags
Attempts:
2 left
💡 Hint
Consider version control and team collaboration.
security
advanced
2:00remaining
Security risk in module source declaration
Which module source declaration poses a security risk by allowing untrusted code execution?
Asource = "git::https://github.com/trusted/repo.git"
Bsource = "git::https://github.com/untrusted/repo.git"
Csource = "terraform-aws-modules/vpc/aws"
Dsource = "./modules/network"
Attempts:
2 left
💡 Hint
Consider trustworthiness of the source repository.
service_behavior
expert
2:00remaining
Terraform behavior with missing module source
What happens when Terraform init runs with a module source pointing to a non-existent Git repository URL?
ATerraform init fails with an error about unreachable source
BTerraform init downloads an empty module directory
CTerraform init completes successfully but skips the module
DTerraform init ignores the module and continues
Attempts:
2 left
💡 Hint
Terraform requires module sources to be accessible during init.