wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Terraform Day 3 Accenture

Total questions: 24

Worksheet time: 9mins

Name
Class
Date
1.

You write a new Terraform configuration and immediately run terraform apply in the CLI using the local backend. Why will the apply fail?

a)

Terraform needs you to format your code according to best practices first

b)

Terraform needs to install the necessary plugins first

c)

The Terraform CLI needs you to log into Terraform cloud first

d)

Terraform requires you to manually run terraform plan first

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.

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

8.

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

9.

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

10.

What is the default backends used by terraform CLI?

a)

Terraform Cloud

b)

Consul

c)

Remote

d)

Local

11.

What does the default "local" Terraform backend store?

a)
  • tfplan files

b)
  • Terraform binary

c)
  • Provider plugins

d)
  • State file

12.

what contains a terraform state?

a)

The mapping of the resource's configuration

b)

Information of the real infrastructure

c)

Metadata of the resources created

13.

Why is it useful to use remote backends?

a)

To work in a team

b)

for remote operations

c)

for state locking

14.

By default, where does Terraform store its state file?​

a)

remotely using Terraform Cloud​

b)

current working directory​

c)

shared directory​

d)

Amazon S3 bucket​

15.

Which of these provisioners can execute a command on the machine where Terraform is run?

a)

remote-exec

b)

local-exec

c)

script-exec

d)

manual-exec

16.

Which provisioner would you use to transfer files to a remote machine in Terraform?

a)

file

b)

upload-exec

c)

remote-exec

d)

local-exec

17.

What is the key difference between local-exec and remote-exec provisioners in Terraform?

a)

local-exec runs on the target resource, and remote-exec runs on the local machine

b)

local-exec runs on the local machine, and remote-exec runs on the target resource

c)

local-exec runs before resource creation, while remote-exec runs after

d)

There is no difference; both run the same commands

18.

When using the file provisioner in Terraform, which parameter specifies the file to be uploaded?

a)

source

b)

destination

c)

content

d)

remote_path

19.

Which command is used to initialize a backend configuration in Terraform?

a)

terraform init

b)

terraform backend

c)

terraform state

d)

terraform configure

20.

What is the default locking mechanism used by Terraform when using a remote backend to prevent simultaneous state file changes when using S3 backend.

a)

File locks

b)

Resource locks

c)

DynamoDB locks

d)

Terraform does not support locking for remote

21.

Which connection type is supported by Terraform for connecting to a remote machine for provisioning?

a)

ssh

b)

ftp

c)

http

d)

rdp

22.

Which GCP service is typically used for storing remote state files in Terraform?

a)

Google Cloud Datastore

b)

Google Cloud Storage (GCS)

c)

Google Cloud Bigtable

d)

Google Cloud Functions

23.

Where is the backend block typically located within a Terraform configuration file?

a)

Inside the provider block

b)

At the beginning of the file, outside of any block.

c)

Inside the terraform block.

d)

After the resource definitions

24.

Which of the following actions will NOT trigger a reinitialization of the backend in Terraform?

a)

Changing the backend configuration values

b)

Running terraform plan

c)

Running terraform init -reconfigure

d)

Switching from a local backend to a remote backend