0
0
Terraformcloud~10 mins

Terraform.tfvars file - Interactive Code Practice

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

Complete the code to assign a value to the variable 'region' in a Terraform.tfvars file.

Terraform
region = "[1]"
Drag options to blanks, or click blank then click option'
Aus-west-2
Btrue
C123
Dnull
Attempts:
3 left
💡 Hint
Common Mistakes
Using boolean or numeric values instead of a string for region.
Forgetting to put quotes around the region value.
2fill in blank
medium

Complete the code to assign a list of availability zones in Terraform.tfvars format.

Terraform
availability_zones = [1]
Drag options to blanks, or click blank then click option'
A{us-west-2a, us-west-2b}
B"us-west-2a, us-west-2b"
Cus-west-2a, us-west-2b
D["us-west-2a", "us-west-2b"]
Attempts:
3 left
💡 Hint
Common Mistakes
Using curly braces instead of square brackets for lists.
Not quoting the strings inside the list.
3fill in blank
hard

Fix the error in the Terraform.tfvars assignment for the variable 'enable_logging'.

Terraform
enable_logging = [1]
Drag options to blanks, or click blank then click option'
Atrue
B'true'
CTrue
D"true"
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around boolean values.
Capitalizing boolean values.
4fill in blank
hard

Fill both blanks to assign a map variable in Terraform.tfvars format.

Terraform
tags = { [1] = "Production", [2] = "WebApp" }
Drag options to blanks, or click blank then click option'
AEnvironment
BName
CVersion
DOwner
Attempts:
3 left
💡 Hint
Common Mistakes
Quoting keys in maps.
Using incorrect key names.
5fill in blank
hard

Fill all three blanks to assign variables of different types in Terraform.tfvars.

Terraform
instance_count = [1]
instance_type = "[2]"
enabled = [3]
Drag options to blanks, or click blank then click option'
A3
Bt3.micro
Ctrue
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Quoting numbers or booleans.
Using uppercase for boolean values.