wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Terraform KPMG Day 5

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

In your Terraform configuration, you have two resources: an AWS S3 bucket and an AWS EC2 instance. You want to ensure that the EC2 instance is provisioned only after the S3 bucket is successfully created.

Which Terraform attribute should you use to establish this dependency?

a)

requires

b)

after

c)

depends_on

d)

connected_to

2.

Your team is collaborating on a Terraform project, and you're concerned about potential conflicts when multiple team members try to apply changes simultaneously. Which feature of Terraform helps prevent such conflicts?

a)

State management

b)

Locking

c)

State commands

d)

Terraform Cloud

3.

You want to inspect the details of resources managed by Terraform within your project. Which Terraform command should you use?

a)

terraform plan

b)

terraform apply

c)

terraform show

d)

terraform state list

4.

You want to list all resources tracked by Terraform within your project. Which Terraform command would provide you with this information?

a)

terraform state list

b)

terraform state show

c)

terraform state pull

d)

terraform state refresh

5.

In your Terraform project, you have accidentally deleted an EC2 resource outside of Terraform, and now you need to remove it from Terraform's state file to avoid conflicts. Which Terraform command should you use to remove the resource from the state file?

a)

terraform state remove aws_instance.example

b)

terraform state rm aws_instance.example

c)

terraform state delete aws_instance.example

d)

terraform state clean aws_instance.example

6.

Where in your Terraform configuration do you specify a state backend?

a)

The terraform block

b)

The resource block

c)

The provider block

d)

The datasource block

7.

After making several changes to your infrastructure, you realize that the state file includes some outdated resources that no longer exist. Which command can remove these resources from the state file without affecting the actual infrastructure?

a)

terraform destroy

b)

terraform state rm

c)

terraform state mv

d)

terraform state pull

8.

If you want to list all resources managed by a specific Terraform state file before merging, which command should you use?

a)

terraform state show

b)

terraform state list

c)

terraform plan

d)

terraform import

9.

You suspect there might be issues with your current state file and want to manually inspect its contents. Which command would you use to download and view the state file in JSON format?

a)

terraform state show

b)

terraform state pull

c)

terraform plan

d)

terraform state list

10.

You need to inspect the details of a specific resource within your state file to verify its attributes. Which command should you use?

a)

terraform state list

b)

terraform state show

c)

terraform plan

d)

terraform state mv

11.

You want to clean up your state file by removing resources that are no longer needed, but you want to confirm the exact resource names first. Which sequence of commands should you use?

a)

terraform plan followed by terraform destroy

b)

terraform state list followed by terraform state rm

c)

terraform state show followed by terraform state rm

d)

terraform apply followed by terraform state rm

12.

When should you use terraform init -reconfigure?

a)
  • When adding a new resource to your configuration

b)
  • When changing the backend configuration details

c)
  • When viewing the current state of the infrastructure

d)
  • When upgrading Terraform to a new version

13.

Which terraform command can be executed without initializing terraform?

a)

terraform format

b)

terraform plan

c)

terraform fmt

d)

terraform apply

14.

When does terraform apply reflect changes in the cloud environment

a)

Immediately

b)

however long it takes the provider to fulfill the request

c)

After updating the state file

d)

After a minimum wait period of 1 min

15.

All standard backends support state storage, locking, and remote operations like plan, apply and destroy

a)

True

b)

False

16.

What is the default backends used by terraform CLI?

a)

Terraform Cloud

b)

Consul

c)

Remote

d)

Local

17.

Which statement describes a goal of IAC?

a)

An abstraction from vendor specific APIs

b)

Write once, run anywhere

c)

A pipeline process to test and deliver software

d)

The programmatic configuration of resources

18.

A Terraform local value can reference other Terraform variables

a)

True

b)

False

19.

Terraform can run on Windows or Linux, but it requires a Server version of the Windows operating system.

a)

True

b)

False

20.

What does the default "local" Terraform backend store?

a)
  • tfplan files

b)
  • Terraform binary

c)
  • Provider plugins

d)
  • State file