0
0
Terraformcloud~10 mins

Why automated Terraform matters - Test Your Understanding

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

Complete the code to initialize a Terraform working directory.

Terraform
terraform [1]
Drag options to blanks, or click blank then click option'
Aapply
Binit
Cplan
Ddestroy
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apply' before initializing causes errors.
Confusing 'plan' with initialization.
2fill in blank
medium

Complete the code to create an execution plan without applying changes.

Terraform
terraform [1]
Drag options to blanks, or click blank then click option'
Aplan
Bvalidate
Cdestroy
Dapply
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apply' runs changes immediately.
Using 'validate' only checks syntax.
3fill in blank
hard

Fix the error in the command to apply changes automatically without confirmation.

Terraform
terraform apply [1]
Drag options to blanks, or click blank then click option'
A-confirm
B-force
C-yes
D-auto-approve
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-yes' is not a valid Terraform flag.
Using '-force' or '-confirm' causes errors.
4fill in blank
hard

Fill both blanks to define a Terraform resource with a name and type.

Terraform
resource "[1]" "[2]" {
  # resource configuration
}
Drag options to blanks, or click blank then click option'
Aaws_instance
Bmy_server
Cgoogle_compute_instance
Dexample
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping resource type and name.
Using invalid resource types.
5fill in blank
hard

Fill all three blanks to output the public IP of an AWS instance after deployment.

Terraform
output "[1]" {
  value = [2].[3]
}
Drag options to blanks, or click blank then click option'
Ainstance_ip
Baws_instance.my_server
Cpublic_ip
Dprivate_ip
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'private_ip' instead of 'public_ip' when public IP is needed.
Incorrect resource address format.