0
0
Terraformcloud~10 mins

Module sources (local, registry, git) in Terraform - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to use a local module source.

Terraform
module "example" {
  source = "[1]"
}
Drag options to blanks, or click blank then click option'
Aregistry.terraform.io/example/module
Bterraform-aws-modules/vpc/aws
Cgit::https://github.com/example/module.git
D./modules/example
Attempts:
3 left
💡 Hint
Common Mistakes
Using a registry or git URL instead of a local path.
Forgetting to use quotes around the path.
2fill in blank
medium

Complete 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'
Aterraform-aws-modules/vpc/aws
Bgit::https://github.com/terraform-aws-modules/vpc.git
C./modules/vpc
Dhttps://registry.terraform.io/modules/vpc
Attempts:
3 left
💡 Hint
Common Mistakes
Using a local path or git URL instead of the registry format.
Including https:// in the source.
3fill in blank
hard

Fix the error in the git module source URL.

Terraform
module "network" {
  source = "[1]"
}
Drag options to blanks, or click blank then click option'
Agit::https://github.com/terraform-modules/network.git
Bhttps://github.com/terraform-modules/network.git
Cgithub.com/terraform-modules/network.git
Dgit@github.com:terraform-modules/network.git
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the git:: prefix.
Using SSH URL without git:: prefix.
4fill in blank
hard

Fill 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'
Agit::https://github.com/example/app.git
Bmain
Cv1.0.0
Dgit::https://github.com/example/app
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.
5fill in blank
hard

Fill 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'
Aterraform-aws-modules/rds/aws
B3.2.1
C./modules/db
D./modules/rds
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing registry format with local paths.
Using invalid version formats.