wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Terraform KPMG Day 1

Total questions: 15

Worksheet time: 9mins

Name
Class
Date
1.

How would you define Terraform?

a)

A configuration management tool

b)

An orchestration tool

c)

An infrastructure as code tool

d)

A continuous integration tool

2.

What is the primary language used by terraform to define resources and infrastructure?

a)

YAML

b)

JSON

c)

HCL

d)

XML

3.

Which command initializes the terraform configuration?

a)

terraform start

b)

terraform init

c)

terraform fmt

d)

terraform apply

4.

What does the terraform plan command do?

a)

Applies the changes required to reach the desired state of the configuration

b)

Shows the execution plan for the changes required to reach the desired state

c)

Initializes the configuration

d)

Deletes the resources defined in the configuration

5.

Which file format is used by Terraform to store infrastructure state data?

a)

YAML

b)

HCL

c)

JSON

d)

XML

6.

Which among the following is an apt description of Terraform providers?

a)

A module that provides configuration files

b)

A plugin that allows Terraform to interact with cloud providers

c)

A feature to manage multiple configurations

d)

A tool to visualize infrastructure

7.

When checking the syntax of Terraform configuration files, which command ought to be executed?

a)

terraform check

b)

terraform validate

c)

terraform plan

d)

terraform fmt

8.

How can you format Terraform configuration files?

a)

terraform plan

b)

terraform validate

c)

terraform fmt

d)

terraform format

9.

What is the purpose of the Terraform state file?

a)

To store the configuration files

b)

To store metadata about terraform

c)

To keep track of resources managed by Terraform

d)

To define variables and outputs

10.

Which two Terraform commands will refresh the state automatically unless given additional flags or arguments? Choose TWO correct answers.

a)

terraform plan

b)

terraform state

c)

terraform apply

d)

terraform validate

11.

What happens when you apply Terraform configuration? Choose TWO correct answers.

a)

Terraform makes any infrastructure changes that are defined in your configuration.

b)

Terraform gets the plugins that the configuration requires.

c)

Terraform updates the state file with the configuration changes it made.

d)

Terraform will destroy and recreate all your infrastructure from scratch.

12.

What is the workflow for deploying new infrastructure when using Terraform?

a)

Use the Terraform plan command to import the current infrastructure to the state file, make code changes, and run the Terraform apply command to update the infrastructure.

b)

Write the Terraform configuration, run the terraform show command to view proposed changes, and run terraform apply to create the new infrastructure.

c)

Terraform import is used to import the current infrastructure to the state file, make code changes, and apply terraform to update the infrastructure.

d)

Write a Terraform configuration, run Terraform init, run Terraform plan to view planned infrastructure changes, and terraform apply to create new infrastructure.

13.

You've used Terraform to construct a cloud-based development environment and are now prepared to destroy all of the infrastructure outlined in your Terraform setup. To be safe, you should first view all of the infrastructure that Terraform would remove.

Which terraform command will show all of the resources to be deleted? (Choose two.)

a)

Run terraform plan -destroy.

b)

This is not possible. You can just display the resources that will be created.

c)

Run terraform state rm *.

d)

Run terraform destroy first which will first output all the resources that will be deleted before prompting for approval.

14.

Which task does the Terraform init command NOT perform?

a)

Ensures that all providers in the setup are downloaded and available locally.

b)

Connects to the backend

c)

Locates any modules and replicates the configuration locally.

d)

Validates all required variables are present

15.

You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. Your shared team account currently holds fifteen virtual machines (VMs). You develop a Terraform configuration containing one VM, perform terraform apply, and see that your VM was created successfully.

What exactly must be done to delete your newly generated Terraform VM?

a)

The Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and select the newly-created VM.

b)

The Terraform state file contains only one new VM. Execute terraform destroy.

c)

Delete the Terraform state file and execute Terraform apply.

d)

Delete the VM from the cloud service provider console and run Terraform apply to set up the modifications into the Terraform state file.