0
0
Terraformcloud~10 mins

Terraform Registry modules - 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 Terraform Registry module named "vpc".

Terraform
module "my_vpc" {
  source = [1]
}
Drag options to blanks, or click blank then click option'
A"aws_vpc"
B"registry/vpc"
C"vpc_module"
D"terraform-aws-modules/vpc/aws"
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect source format like just the module name.
Forgetting to include the provider in the source.
2fill in blank
medium

Complete the code to specify the version of the Terraform Registry module.

Terraform
module "my_vpc" {
  source  = "terraform-aws-modules/vpc/aws"
  version = [1]
}
Drag options to blanks, or click blank then click option'
A"3.14.0"
B3.14
C"latest"
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number without quotes for version.
Using invalid version strings like "latest".
3fill in blank
hard

Fix the error in the module block to correctly pass the VPC CIDR block.

Terraform
module "my_vpc" {
  source     = "terraform-aws-modules/vpc/aws"
  version    = "3.14.0"
  [1] = "10.0.0.0/16"
}
Drag options to blanks, or click blank then click option'
Acidrblock
Bcidr
CcidrBlock
Dcidr_block
Attempts:
3 left
💡 Hint
Common Mistakes
Using camelCase or incorrect variable names.
Using partial or abbreviated variable names.
4fill in blank
hard

Fill both blanks to define a module with source and enable DNS support.

Terraform
module "my_vpc" {
  source          = [1]
  enable_dns_hostnames = [2]
}
Drag options to blanks, or click blank then click option'
A"terraform-aws-modules/vpc/aws"
Btrue
Cfalse
D"true"
Attempts:
3 left
💡 Hint
Common Mistakes
Quoting boolean values like "true".
Using incorrect source strings.
5fill in blank
hard

Fill all three blanks to define a module with source, version, and enable public subnets.

Terraform
module "my_vpc" {
  source        = [1]
  version       = [2]
  public_subnets = [3]
}
Drag options to blanks, or click blank then click option'
A"terraform-aws-modules/vpc/aws"
B"3.14.0"
C["10.0.1.0/24", "10.0.2.0/24"]
Dtrue
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted version numbers.
Passing booleans instead of lists for subnets.
Incorrect source strings.