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

Terraform-Associate-003 HashiCorp Certified: Terraform Associate (003) (HCTA0-003) Questions and Answers

Questions 4

terraform init retrieves and caches the configuration for all remote modules.

Options:

A.

True

B.

False

Buy Now
Questions 5

Outside of the required_providers block, Terraform configurations always refer to providers by their local names.

Options:

A.

True

B.

False

Buy Now
Questions 6

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

Buy Now
Questions 7

Before you can use a remote backend, you must first execute terra-form init.

Options:

A.

True

B.

False

Buy Now
Questions 8

How is terraform import run?

Options:

A.

As a part of terraform init

B.

As a part of terraform plan

C.

As a part of terraform refresh

D.

By an explicit call

E.

All of the above

Buy Now
Questions 9

You're building a CI/CD (continuous integration/continuous delivery) pipeline and need to inject sensitive variables into your Terraform run. How can you do this safely?

Options:

A.

Copy the sensitive variables into your Terraform code

B.

Store the sensitive variables in a secure_varS.tf file

C.

Store the sensitive variables as plain text in a source code repository

D.

Pass variables to Terraform with a -var flag

Buy Now
Questions 10

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

Buy Now
Questions 11

A module can always refer to all variables declared in its parent module.

Options:

A.

True

B.

False

Buy Now
Questions 12

Terraform providers are part of the Terraform core binary.

Options:

A.

True

B.

False

Buy Now
Questions 13

You have just developed a new Terraform configuration for two virtual machines with a cloud provider. You would like to create the infrastructure for the first time.

Which Terraform command should you runfirst?

Options:

A.

terraform apply

B.

terraform init

C.

terraform plan

D.

terraform show

Buy Now
Questions 14

Which command must you first run before performing further Terraform operations in a working directory?

Options:

A.

terraform import

B.

terraform workspace

C.

terraform plan

D.

terraform init

Buy Now
Questions 15

You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains 15 virtual machines (VM). You develop a Terraform configuration containing one VM. perform terraform apply, and see that your VM was created successfully. What should you do to delete the newly-created VM with Terraform?

Options:

A.

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

B.

Delete the Terraform state file and execute terraform apply.

C.

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

D.

Delete the VM using the cloud provider console and terraform apply to apply the changes to the Terraform state file.

Buy Now
Questions 16

When you use a backend that requires authentication, it is best practice to:

Options:

A.

Run all of your Terraform commands on a shared server or container.

B.

Configure the authentication credentials in your Terraform configuration files, and store them in a private version control system.

C.

Use environment variables to configure authentication credentials outside of your Terraform configuration.

D.

None of the above.

Buy Now
Questions 17

terraform validate confirms thesyntaxof Terraform files.

Options:

A.

True

B.

False

Buy Now
Questions 18

A Terraform backend determines how Terraform loads state and stores updates when you execute which command?

Options:

A.

apply

B.

destroy

C.

Both of these are correct.

D.

Neither of these are correct.

Buy Now
Questions 19

What value does the Terraform Cloud private registry provide over the public Terraform Module Registry?

Options:

A.

The ability to share modules publicly with any user of Terraform

B.

The ability to restrict modules to members of Terraform Cloud or Enterprise organizations

C.

The ability to tag modules by version or release

D.

The ability to share modules with public Terraform users and members of Terraform Cloud Organizations

Buy Now
Questions 20

You modified your Terraform configuration and run Terraform plan to review the changes. Simultaneously, your teammate manually modified the infrastructure component you are working on. Since you already ran terraform plan locally, the execution plan for terraform apply will be the same.

Options:

A.

True

B.

False

Buy Now
Questions 21

terraform apply will fail if you have not run terraform plan first to update the plan output.

Options:

A.

True

B.

False

Buy Now
Questions 22

Which of the following arguments are required when declaring a Terraform output?

Options:

A.

value

B.

description

C.

default

D.

sensitive

Buy Now
Questions 23

How could you reference an attribute from the vsphere_datacenter data source for use with the datacenter_id argument within the vsphere_folder resource in the following configuration?

Options:

A.

Data.vsphere_datacenter.DC.id

B.

Vsphere_datacenter.dc.id

C.

Data,dc,id

D.

Data.vsphere_datacenter,dc

Buy Now
Questions 24

All modules published on the official Terraform Module Registry have been verified by HasihCorp.

Options:

A.

True

B.

False

Buy Now
Questions 25

In a HCP Terraform/Terraform Cloud workspace linked to a version control repository, speculative plan runs start automatically when you merge or commit changes to version control.

Options:

A.

True

B.

False

Buy Now
Questions 26

Which type of block fetches or computes information for use elsewhere in a Terraform configuration?

Options:

A.

data

B.

local

C.

resource

D.

provider

Buy Now
Questions 27

As a member of an operations team that uses infrastructure as code (lac) practices, you are tasked with making a change to an infrastructure stack running in a public cloud. Which pattern would follow laC best practices for making a change?

Options:

A.

Make the change via the public cloud API endpoint

B.

Clone the repository containing your infrastructure code and then run the code

C.

Use the public cloud console to make the change after a database record has been approved

D.

Make the change programmatically via the public cloud CLI

E.

Submit a pull request and wait for an approved merge of the proposed changes

Buy Now
Questions 28

Which of these commands makes your code more human readable?

Options:

A.

Terraform validate

B.

Terraform output

C.

Terraform show

D.

Terraform file

Buy Now
Questions 29

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

Buy Now
Questions 30

Which command lets you experiment with terraform expressions?

Options:

A.

Terraform console

B.

Terraform validate

C.

Terraform env

D.

Terraform test

Buy Now
Questions 31

What does state looking accomplish?

Options:

A.

Prevent accidental Prevent accident deletion of the state file

B.

Blocks Terraform commands from modifying, the state file

C.

Copies the state file from memory to disk

D.

Encrypts any credentials stored within the state file

Buy Now
Questions 32

You have used Terraform lo create an ephemeral development environment in the (loud and are now ready to destroy all the Infrastructure described by your Terraform configuration To be safe, you would like to first see all the infrastructure that Terraform will delete.

Which command should you use to show all of the resources that mil be deleted? Choose two correct answers.

Options:

A.

Run terraform state rm ‘

B.

Run terraform show :destroy

C.

Run terraform destroy and it will first output all the resource that will be deleted before prompting for approval

D.

Run terraform plan .destory

Buy Now
Questions 33

When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)

Options:

A.

When you change a Terraform-managed resource via the Azure Cloud Console, Terraform updates the state file to reflect the change during the next plan or apply

B.

Changing resources via the Azure Cloud Console records the change in the current state file

C.

When you change a resource via the Azure Cloud Console, Terraform records the changes in a new state file

D.

Changing resources via the Azure Cloud Console does not update current state file

Buy Now
Questions 34

You created infrastructure outside the Terraform workflow that you now want to manage using Terraform. Which command brings the infrastructure into Terraform state?

Options:

A.

terraform get

B.

terraform refresh

C.

terraform import

D.

terraform init

Buy Now
Questions 35

What command can you run to generateDOT (Graphviz)formatted data to visualize Terraform dependencies?

Options:

A.

terraform refresh

B.

terraform graph

C.

terraform output

D.

terraform show

Buy Now
Questions 36

Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?

Options:

A.

terraform destroy, then terraform apply

B.

terraform init

C.

terraform push

D.

terraform apply

Buy Now
Questions 37

Your root module contains a variable namednum_servers. Which is the correct way to pass its value to a child module with an input namedservers?

Options:

A.

servers = num_servers

B.

servers = var(num_servers)

C.

servers = var.num_servers

D.

servers = ${var.num_servers}

Buy Now
Questions 38

A Terraform output that sets the "sensitive" argument to true will not store that value in the state file.

Options:

A.

True

B.

False

Buy Now
Questions 39

Terraformrequiresthe Go runtime as a prerequisite for installation.

Options:

A.

True

B.

False

Buy Now
Questions 40

You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (* files). You need to enable additional logging messages to find this out. Which of the following would achieve this?

Options:

A.

Set verbose for each provider in your Terraform configuration

B.

Set the environment variable TF_LOG_TRACE

C.

Set the environment variable TF_LOG_PATH

D.

Set the environment variable TF_log_TRACE

Buy Now
Questions 41

You use a cloud provider account that is shared with other team members. You previously used Terraform to create a load balancer that listens on port 80. After application changes, you updated the Terraform code to change the port to 443.

You run terraform plan and see that the execution plan shows the port changing from 80 to 443 like you intended and step away to grab some coffee.

In the meantime, another team member manually changes the load balancer port to 443 through the cloud provider console before you get back to your desk.

What will happen when you run terraform apply upon returning to your desk?

Options:

A.

Terraform will recreate the load balancer.

B.

Terraform will fail with an error because the state file is no longer accurate.

C.

Terraform will change the load balancer port to 80, and then change it back to 443.

D.

Terraform will not make any changes to the load balancer and will update the state file to reflect the manual change.

Buy Now
Questions 42

When do you need to explicitly execute Terraform in refresh-only mode?

Options:

A.

Before every terraform plan.

B.

Before every terraform apply.

C.

Before every terraform import.

D.

None of the above.

Buy Now
Questions 43

Which parameters does terraform import require? Choose two correct answers.

Options:

A.

Provider

B.

Resource ID

C.

Resource address

D.

Path

Buy Now
Questions 44

Terraform variables and outputs that set the description argument will store that description in the state file.

Options:

A.

True

B.

False

Buy Now
Questions 45

When using multiple configuration of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?

Options:

A.

Alias

B.

Id

C.

Depends_on

D.

name

Buy Now
Questions 46

While attempting to deploy resources into your cloud provider using Terraform, you begin to see some odd behavior and experience slow responses. In order to troubleshoot you decide to turn on Terraform debugging. Which environment variables must be configured to make Terraform's logging more verbose?

Options:

A.

TF_LOG_PAIH

B.

TF_LOG

C.

TF_VAR_log_path

D.

TF_VAR_log_level

Buy Now
Questions 47

Where does the Terraform local backend store its state?

Options:

A.

In the terraform file

B.

In the /tmp directory

C.

In the terraform,tfstate file

D.

In the user’s terraform,state file

Buy Now
Questions 48

What does Terraform use the .terraform.lock.hc1 file for?

Options:

A.

There is no such file

B.

Tracking specific provider dependencies

C.

Preventing Terraform runs from occurring

D.

Storing references to workspaces which are locked

Buy Now
Questions 49

When does Terraform create the .terraform.lock.hc1 file?

Options:

A.

After your first terraform plan

B.

After your first terraform apply

C.

After your first terraform init

D.

When you enable state locking

Buy Now
Questions 50

When do changes invoked by terraform apply take effect?

Options:

A.

After Terraform has updated the state file

B.

Once the resource provider has fulfilled the request

C.

Immediately

D.

None of the above are correct

Buy Now
Questions 51

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.

Buy Now
Questions 52

Which are examples of infrastructure as code? Choose two correct answers.

Options:

A.

Cloned virtual machine images

B.

Versioned configuration files

C.

Change management database records

D.

Doctor files

Buy Now
Questions 53

You want to use API tokens and other secrets within your team's Terraform workspaces. Where does HashiCorp recommend you store these sensitive values? (Pick the 3 correct responses)

Options:

A.

In an HCP Terraform/Terraform Cloud variable, with the sensitive option checked.

B.

In HashiCorp Vault.

C.

In a terraform.tfvars file, securely managed and shared with your team.

D.

In a terraform.tfvars file, checked into your version control system.

E.

In a plaintext document on a shared drive.

Buy Now
Questions 54

A child module can always access variables declared in its parent module.

Options:

A.

True

B.

False

Buy Now
Questions 55

Which of the following does terraform apply change after you approve the execution plan? (Choose two.)

Options:

A.

Cloud infrastructure

B.

The .terraform directory

C.

The execution plan

D.

State file

E.

Terraform code

Buy Now
Questions 56

Which two steps are required to provision new infrastructure in the Terraform workflow? Choose two correct answers.

Options:

A.

Plan

B.

Import

C.

Alidate

D.

Init

E.

apply

Buy Now
Questions 57

When does Sentinel enforce policy logic during a Terraform Cloud run?

Options:

A.

Before the plan phase

B.

During the plan phase

C.

Before the apply phase

D.

After the apply phase

Buy Now
Questions 58

Before you can use a new backend or HCP Terraform/Terraform Cloud integration, you must first execute terraform init.

Options:

A.

True

B.

False

Buy Now
Questions 59

You have a simple Terraform configuration containing one virtual machine (VM) in a cloud provider. You run terraform apply and the VM is created successfully. What will happen if you terraform apply again immediately afterward without changing any Terraform code?

Options:

A.

Terraform will terminate and recreate the VM.

B.

Terraform will create another duplicate VM.

C.

Terraform will apply the VM to the state file.

D.

Nothing

Buy Now
Questions 60

If a module declares a variable with a default, that variable must also be defined within the module.

Options:

A.

True

B.

False

Buy Now
Questions 61

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

Options:

A.

True

B.

False

Buy Now
Questions 62

What is modified when executing Terraform inrefresh-only mode?

Options:

A.

Your Terraform configuration.

B.

Your Terraform plan.

C.

Your state file.

D.

Your cloud infrastructure.

Buy Now
Questions 63

terraform plan updates your state file.

Options:

A.

True

B.

False

Buy Now
Questions 64

You have declared a variable called var.list which is a list of objects that all have an attribute id . Which options will produce a list of the IDs? Choose two correct answers.

Options:

A.

[ var.list [ * ] , id ]

B.

[ for o in var.list : o.Id ]

C.

var.list[*].id

D.

{ for o in var.llst : o => o.id }

Buy Now
Questions 65

In a Terraform Cloud workspace linked to a version control repository, speculative plan runs start automatically when you merge or commit changes to version control.

Options:

A.

True

B.

False

Buy Now
Questions 66

Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?

Options:

A.

Terraform state show ‘ provider_type_name

B.

Terraform state list

C.

Terraform get provider_type_name

D.

Terraform state list provider_type_name

Buy Now
Questions 67

You want to define multiple data disks as nested blocks inside the resource block for a virtual machine. What Terraform feature would help you define the blocks using the values in a variable?

Options:

A.

Local values

B.

Count arguments

C.

Collection functions

D.

Dynamic blocks

Buy Now
Questions 68

terraform apply is failing with the following error. What next step should you take to determine the root cause of the problem?

Error:

yaml

CopyEdit

Error loading state: AccessDenied: Access Denied

status code: 403, request id: 288766CE5CCA24A0, host id: web.example.com

Options:

A.

Run terraform login to reauthenticate with the provider.

B.

Set TF_LOG=DEBUG.

C.

Review /var/log/terraform.log for error messages.

D.

Review syslog for Terraform error messages.

Buy Now
Questions 69

Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?

Options:

A.

terraform fmt -write-false

B.

terraform fmt -list -recursive

C.

terraform fmt -check -recursive

D.

terraform fmt -check

Buy Now
Questions 70

What feature stops multiple users from operating on the Terraform state at the same time?

Options:

A.

State locking

B.

Version control

C.

Provider constraints

D.

Remote backends

Buy Now
Questions 71

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

Buy Now
Exam Name: HashiCorp Certified: Terraform Associate (003) (HCTA0-003)
Last Update: Sep 17, 2025
Questions: 239
Terraform-Associate-003 pdf

Terraform-Associate-003 PDF

$29.75  $84.99
Terraform-Associate-003 Engine

Terraform-Associate-003 Testing Engine

$35  $99.99
Terraform-Associate-003 PDF + Engine

Terraform-Associate-003 PDF + Testing Engine

$47.25  $134.99