Summer Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70percent

HashiCorp Terraform-Associate-003 HashiCorp Certified: Terraform Associate (003) Exam Practice Test

HashiCorp Certified: Terraform Associate (003) Questions and Answers

Question 1

Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.

Options:

A.

True

B.

False

Question 2

What is the Terraform style convention for indenting a nesting level compared to the one above it?

Options:

A.

With a tab

B.

With two spaces

C.

With four spaces

D.

With three spaces

Question 3

You cannot install third party plugins using terraform init.

Options:

A.

True

B.

False

Question 4

One remote backend configuration always maps to a single remote workspace.

Options:

A.

True

B.

False

Question 5

Define the purpose of state in Terraform.

Options:

A.

State maps real world resources to your configuration and keeps track of metadata

B.

State lets you enforce resource configurations that relate to compliance policies

C.

State stores variables and lets you quickly reuse existing code

D.

State codifies the dependencies of related resources

Question 6

You have to initialize a Terraform backend before it can be configured.

Options:

A.

True

B.

False

Question 7

Your DevOps team is currently using the local backend for your Terraform configuration. You would like to move to a remote backend to store the state file in a central location. Which of the following backends would not work?

Options:

A.

Artifactory

B.

Amazon S3

C.

Terraform Cloud

D.

Git

Question 8

You ate making changes to existing Terraform code to add some new infrastructure. When is the best time to run terraform validate?

Options:

A.

After you run terraform apply so you can validate your infrastructure

B.

Before you run terraform apply so you can validate your provider credentials

C.

Before you run terraform plan so you can validate your code syntax

D.

After you run terraform plan so you can validate that your state file is consistent with your infrastructure

Question 9

Terraform providers are always installed from the Internet.

Options:

A.

True

B.

False

Question 10

When should you run terraform init?

Options:

A.

Every time you run terraform apply

B.

Before you start coding a new Terraform project

C.

After you run terraform plan for the time in a new terraform project and before you run terraform apply

D.

After you start coding a new terraform project and before you run terraform plan for the first time.

Question 11

In Terraform HCL, an object type of object({name=string, age-number}) would match this value.

A)

B)

C)

D)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 12

Which of these is true about Terraform's plugin-based architecture?

Options:

A.

Terraform can only source providers from the internet

B.

Every provider in a configuration has its own state file for its resources

C.

You can create a provider for your API if none exists

D.

All providers are part of the Terraform core binary

Question 13

What does Terraform not reference when running a terraform apply -refresh-only ?

Options:

A.

State file

B.

Credentials

C.

Cloud provider

D.

Terraform resource definitions in configuration files

Question 14

Which of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.

Options:

A.

Lets you version, reuse, and share infrastructure configuration

B.

Provisions the same resources at a lower cost

C.

Secures your credentials

D.

Reduces risk of operator error

E.

Prevents manual modifications to your resources

Question 15

Only the user that generated a plan may apply it.

Options:

A.

True

B.

False

Question 16

Which task does terraform init not perform?

Options:

A.

Validates all required variables are present

B.

Sources any modules and copies the configuration locally

C.

Connects to the backend

D.

Sources all providers used in the configuration and downloads them

Question 17

Terraform configuration can only import modules from the public registry.

Options:

A.

True

B.

False

Question 18

Which configuration consistency errors does terraform validate report?

Options:

A.

Terraform module isn't the latest version

B.

Differences between local and remote state

C.

Declaring a resource identifier more than once

D.

A mix of spaces and tabs in configuration files

Question 19

_______backends support state locking.

Options:

A.

All

B.

No

C.

Some

D.

Only local

Question 20

Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.

Options:

A.

A variable file

B.

Defined in Environment variables

C.

Inside the backend block within the Terraform configuration

D.

Defined in a connection configuration outside of Terraform

Question 21

Variables declared within a module are accessible outside of the module.

Options:

A.

True

B.

False

Question 22

Which of these ate features of Terraform Cloud? Choose two correct answers.

Options:

A.

Automated infrastructure deployment visualization

B.

Automatic backups

C.

A web-based user interface (Ul)

D.

Remote state storage

Question 23

terraform validate reports syntax check errors for which of the following?

Options:

A.

Code contains tabs for indentation instead of spaces

B.

There is a missing value for a variable

C.

The state file does not match the current infrastructure

D.

None of the above

Question 24

The public Terraform Module Registry is free to use.

Options:

A.

True

B.

False

Question 25

Which of the following is not a valid Terraform variable type?

Options:

A.

list

B.

array

C.

nap

D.

string

Question 26

What kind of configuration block will create an infrastructure object with settings specified within the block?

Options:

A.

provider

B.

state

C.

data

D.

resource

Question 27

You add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The existing and new resources use the same provider. The working contains a .terraform.lock, hc1 file.

How will Terraform choose which version of the provider to use?

Options:

A.

Terraform will use the version recorded in your lock file

B.

Terraform will use the latest version of the provider for the new resource and the version recorded in the lock file to manage existing resources

C.

Terraform will check your state file to determine the provider version to use

D.

Terraform will use the latest version of the provider available at the time you provision your new resource

Question 28

You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into a file called backend.tf.

Which command will migrate your current state file to the new S3 remote backend?

Options:

A.

terraform state

B.

terraform init

C.

terraform push

D.

terraform refresh

Question 29

If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform Init.

Options:

A.

True

B.

False

Question 30

What type of block is used to construct a collection of nested configuration blocks?

Options:

A.

Dynamic

B.

For_each

C.

Nesting

D.

repeated.

Question 31

Terraform providers are part of the Terraform core binary.

Options:

A.

True

B.

False

Question 32

When should you use the force-unlock command?

Options:

A.

You have a high priority change

B.

Automatic unlocking failed

C.

apply failed due to a state lock

D.

You see a status message that you cannot acquire the lock

Question 33

Which command add existing resources into Terraform state?

Options:

A.

Terraform init

B.

Terraform plan

C.

Terraform refresh

D.

Terraform import

E.

All of these

Question 34

Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument.

Options:

A.

True

B.

False

Question 35

You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with Terraform and want to manage these VMs using Terraform instead. What are the two things you must do to achieve this? Choose two correct answers.

Options:

A.

Run the terraform Import-gcp command

B.

Write Terraform configuration for the existing VMs

C.

Use the terraform import command for the existing VMs

D.

Provision new VMs using Terraform with the same VM names

Question 36

You can configure Terraform to log to a file using the TF_LOG environment variable.

Options:

A.

True

B.

False

Question 37

A developer accidentally launched a VM (virtual machine) outside of the Terraform workflow and ended up with two servers with the same name. They don't know which VM Terraform manages but do have a list of all active VM IDs.

Which of the following methods could you use to discover which instance Terraform manages?

Options:

A.

Run terraformstate list to find the names of all VMs, then run terraform state show for each of them to find which VM ID Terraform manages

B.

Update the code to include outputs for the ID of all VMs, then runterraformplan to view the outputs

C.

Run terraform taint/code on all the VMs to recreate them

D.

Use terraform refresh/code to find out which IDs are already part of state

Question 38

How can a ticket-based system slow down infrastructure provisioning and limit the ability to scale? Choose two correct answers.

Options:

A.

End-users have to request infrastructure changes

B.

Ticket based systems generate a full audit trail of the request and fulfillment process

C.

Users can access catalog of approved resources from drop down list in a request form

D.

The more resources your organization needs, the more tickets your infrastructure team has to process

Question 39

Which provider authentication method prevents credentials from being stored in the state file?

Options:

A.

Using environment variables

B.

Specifying the login credentials in the provider block

C.

Setting credentials as Terraform variables

D.

None of the above

Question 40

What does this code do?

Options:

A.

Requires any version of the AWS provider > = 3.0 and <4.0

B.

Requires any version of the AWS provider >= 3.0

C.

Requires any version of the AWS provider > = 3.0 major release. like 4.1

D.

Requires any version of the AWS provider > 3.0

Question 41

It is best practice to store secret data in the same version control repository as your Terraform configuration.

Options:

A.

True

B.

False

Question 42

A Terraform provider is NOT responsible for:

Options:

A.

Exposing resources and data sources based on an APUI

B.

Managing actions to take based on resources differences

C.

Understanding API interactions with some service

D.

Provisioning infrastructure in multiple

Question 43

You should run terraform fnt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions.

Options:

A.

True

B.

False

Question 44

You must use different Terraform commands depending on the cloud provider you use.

Options:

A.

True

B.

False

Question 45

Which backend does the Terraform CU use by default?

Options:

A.

Depends on the cloud provider configured

B.

HTTP

C.

Remote

D.

Terraform Cloud

E.

Local

Question 46

Which option cannot be used to keep secrets out of Terraform configuration files?

Options:

A.

A Terraform provider

B.

Environment variables

C.

A -var flag

D.

secure string

Question 47

Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?

Options:

A.

curl commands manually run from a terminal

B.

A sequence of REST requests you pass to a public cloud API endpoint Most Voted

C.

A script that contains a series of public cloud CLI commands

D.

A series of commands you enter into a public cloud console

Question 48

Infrastructure as Code (laC) can be stored in a version control system along with application code.

Options:

A.

True

B.

False