0
0
Terraformcloud~20 mins

Terraform Registry modules - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Terraform Registry Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
How does Terraform Registry handle module versioning?

When you specify a module from the Terraform Registry with a version constraint, what happens if a newer version that satisfies the constraint is released?

ATerraform automatically upgrades to the newest version that fits the constraint on the next terraform init.
BTerraform always uses the exact version specified and ignores newer versions.
CTerraform downloads all versions that satisfy the constraint and uses the oldest one.
DTerraform prompts the user to manually select a version each time.
Attempts:
2 left
💡 Hint

Think about how version constraints work in package managers.

Configuration
intermediate
2:00remaining
Correct source syntax for a Terraform Registry module

Which of the following is the correct way to specify a module source from the Terraform Registry for the module networking/vpc/aws version 3.2.0?

Asource = "terraform-registry/networking/vpc/aws" version = "3.2.0"
Bsource = "registry.terraform.io/networking/vpc/aws" version = "3.2.0"
Csource = "networking/vpc/aws" version = "3.2.0"
Dsource = "terraform.io/modules/networking/vpc/aws" version = "3.2.0"
Attempts:
2 left
💡 Hint

Terraform Registry modules use a short source address format.

Architecture
advanced
2:00remaining
Impact of using multiple versions of the same module in one Terraform configuration

You include two modules from the Terraform Registry in your configuration, both named database/mysql/aws, but with different versions: 1.0.0 and 2.0.0. What is the expected behavior during terraform plan and apply?

ATerraform throws an error because multiple versions of the same module are not allowed.
BTerraform uses only the higher version and ignores the lower version module.
CTerraform merges both versions into one module, causing resource conflicts.
DTerraform treats them as separate modules and manages resources independently without conflict.
Attempts:
2 left
💡 Hint

Consider how Terraform identifies modules by their source and version.

security
advanced
2:00remaining
Security best practice when using Terraform Registry modules

What is the best security practice when using modules from the Terraform Registry in your infrastructure code?

AAlways pin the module version to a specific release to avoid unexpected changes.
BDisable module version checks to speed up terraform init.
CModify the module source code directly in the Terraform Registry to add security fixes.
DUse the latest version without pinning to get all security updates automatically.
Attempts:
2 left
💡 Hint

Think about stability and predictability in infrastructure code.

🧠 Conceptual
expert
2:00remaining
How Terraform Registry modules handle provider dependencies

If a Terraform Registry module declares a provider dependency (for example, AWS), how does Terraform handle the provider configuration when you use that module in your root configuration?

AThe module downloads and configures its own provider independently of the root configuration.
BTerraform requires the root configuration to provide the provider configuration; the module uses that configuration automatically.
CTerraform duplicates the provider configuration inside the module, causing conflicts.
DTerraform ignores provider dependencies declared in modules.
Attempts:
2 left
💡 Hint

Think about how Terraform shares providers between root and modules.