Halloween 2025 Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: pass65

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

Questions 4

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 terraform state 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 run terraform plan 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

Buy Now
Questions 5

terraform init creates an example main.tf file in the current directory.

Options:

A.

True

B.

False

Buy Now
Questions 6

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

Options:

A.

True

B.

False

Buy Now
Questions 7

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

Options:

A.

True

B.

False

Buy Now
Questions 8

Where can Terraform not load a provider from?

Options:

A.

Plugins directory

B.

Provider plugin chance

C.

Official HashCrop Distribution on releases.hashcrop.com

D.

Source code

Buy Now
Questions 9

How can terraform plan aid in the development process?

Options:

A.

Initializes your working directory containing your Terraform configuration files

B.

Validates your expectations against the execution plan without permanently modifying state

C.

Formats your Terraform configuration files

D.

Reconciles Terraform's state against deployed resources and permanently modifies state using the current status of deployed resources

Buy Now
Questions 10

Using the terraform state rm command against a resource will destroy it.

Options:

A.

True

B.

False

Buy Now
Questions 11

Options:

A.

Make the change via the public cloud API endpoint.

B.

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

C.

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

D.

Use the public cloud console to make the change after approval.

E.

Make the change programmatically via the cloud CLI.

Buy Now
Questions 12

A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of the resource block?

Options:

A.

test

B.

google

C.

compute_instance

D.

main

Buy Now
Questions 13

Which is the best way to specify a tag of v1.0.0 when referencing a module stored in Git (for example.

Git::https://example.com/vpc.git)?

Options:

A.

Append pref=v1.0.0 argument to the source path

B.

Add version = “1.0.0” parameter to module block

C.

Nothing modules stored on GitHub always default to version 1.0.0

Buy Now
Questions 14

Which of the following is not a benefit of adopting infrastructure as code?

Options:

A.

Versioning

B.

A Graphical User Interface

C.

Reusability of code

D.

Automation

Buy Now
Questions 15

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 16

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

Options:

A.

True

B.

False

Buy Now
Questions 17

Which of the following locations can Terraform use as aprivate sourcefor modules?(Pick 2 correct responses)

Options:

A.

Public repository on GitHub.

B.

Public Terraform Registry.

C.

Internally hosted VCS (Version Control System) platform.

D.

Private repository on GitHub.

Buy Now
Questions 18

terraform validate confirms that your infrastructure matches the Terraform state file.

Options:

A.

True

B.

False

Buy Now
Questions 19

Which of the following is not a valid string function in Terraform?

Options:

A.

chomp

B.

join

C.

slice

D.

split

Buy Now
Questions 20

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 21

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 22

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

Buy Now
Questions 23

You used Terraform to create an ephemeral development environment in the cloud 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 the resources that will be deleted? (Pick the 2 correct responses)

Options:

A.

Runterraform destroy. This will output all the resources that will be deleted before prompting for approval.

B.

Runterraform show -destroy.

C.

Runterraform state rm *.

Buy Now
Questions 24

Which of the following is true about terraform apply?(Pick 2 correct responses)

Options:

A.

You must pass the output of a terraform plan command to it.

B.

By default, it does not refresh your state file to reflect the current infrastructure configuration.

C.

Depending on provider specification, Terraform may need to destroy and recreate your infrastructure resources.

D.

You cannot target specific resources for the operation.

E.

It only operates on infrastructure defined in the current working directory or workspace.

Buy Now
Questions 25

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 26

Which of the following should you put into the required_providers block?

Options:

A.

version >= 3.1

B.

version = “>= 3.1”

C.

version ~> 3.1

Buy Now
Questions 27

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

Buy Now
Questions 28

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 29

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 30

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 31

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 32

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 33

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

Options:

A.

True

B.

False

Buy Now
Questions 34

Which argument can you use toprevent unexpected updatesto a module's configuration when calling Terraform Registry modules?

Options:

A.

source

B.

count

C.

version

D.

lifecycle

Buy Now
Questions 35

All standard backend types support state locking, and remote operations like plan, apply, and destroy.

Options:

A.

True

B.

False

Buy Now
Questions 36

Which of the following isnotan advantage of using Infrastructure as Code (IaC) operations?

Options:

A.

Self-service infrastructure deployment.

B.

Modify a count parameter to scale resources.

C.

API-driven workflows.

D.

Troubleshoot via a Linux diff command.

E.

Public cloud console configuration workflows.

Buy Now
Questions 37

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 38

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

Options:

A.

True

B.

False

Buy Now
Questions 39

Terraform providers are part of the Terraform core binary.

Options:

A.

True

B.

False

Buy Now
Questions 40

What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?

Options:

A.

Terraform plan –refresh-only

B.

Terraform show –json

C.

Terraform apply –lock-false

D.

Terraform plan target-state

Buy Now
Questions 41

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

Buy Now
Questions 42

What type of information can be found on the Terraform Registry when using published modules?

Options:

A.

Required input variables.

B.

Outputs.

C.

Optional input variables and default values.

D.

All of the above.

Buy Now
Questions 43

The public Terraform Module Registry is free to use.

Options:

A.

True

B.

False

Buy Now
Questions 44

Options:

A.

True

B.

False

Buy Now
Questions 45

Which of the following is not a way to trigger terraform destroy?

Options:

A.

Using the destroy command with auto-approve.

B.

Passing --destroy at the end of a plan request.

C.

Running terraform destroy from the correct directory and then typing yes when prompted in the CLI.

Buy Now
Questions 46

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

Buy Now
Questions 47

If a module declares a variable without a default value, you must pass the value of the variable within the module block when you call the module in your configuration.

Options:

A.

True

B.

False

Buy Now
Questions 48

You have multiple team members collaborating on infrastructure as code (IaC) using Terraform, and want to apply formatting standards for readability.

How can you format Terraform HCL (HashiCorp Configuration Language) code according to standard Terraform style convention?

Options:

A.

Run the terraform fmt command during the code linting phase of your CI/CD process Most Voted

B.

Designate one person in each team to review and format everyone's code

C.

Manually apply two spaces indentation and align equal sign "=" characters in every Terraform file (*.tf)

D.

Write a shell script to transform Terraform files using tools such as AWK, Python, and sed

Buy Now
Questions 49

When you run terraform apply, the Terraform CLI will print output values from both the root module and any child modules.

Options:

A.

True

B.

False

Buy Now
Questions 50

What task does the terraform import command perform?

Options:

A.

Imports resources from one Terraform state file to another.

B.

Imports existing resources into Terraform's state file.

C.

Imports a new Terraform module into Terraform's state file.

D.

Imports all infrastructure from the configured cloud provider.

E.

Imports provider configuration from one state file to another.

Buy Now
Questions 51

Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into stdout.

Options:

A.

True

B.

False

Buy Now
Questions 52

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

Buy Now
Questions 53

Options:

A.

fileset("id_rsa.pub")

B.

file("id_rsa.pub")

C.

filebase64("id_rsa.pub")

D.

templatefile("id_rsa.pub")

Buy Now
Questions 54

You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?

Options:

A.

Run terraform refresh.

B.

Run terraform init -upgrade.

C.

Run terraform apply -upgrade.

D.

Upgrade your version of Terraform.

Buy Now
Questions 55

Options:

A.

True

B.

False

Buy Now
Questions 56

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

Options:

A.

True

B.

False

Buy Now
Questions 57

What is a key benefit of the Terraform state file?

Options:

A.

A state file can schedule recurring infrastructure tasks

B.

A state file is a source of truth for resources provisioned with Terraform

C.

A state file is a source of truth for resources provisioned with a public cloud console

D.

A state file is the desired state expressed by the Terraform code files

Buy Now
Questions 58

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 59

Module version is required to reference a module on the Terraform Module Registry.

Options:

A.

True

B.

False

Buy Now
Questions 60

By default, if you do not define a backend for your configuration, where does Terraform store information about the resources that it manages?

Options:

A.

A subdirectory of your home directory named .terraform.d

B.

A file in your configuration's directory named terraform.tfstate

C.

A file in your configuration's directory named .terraform.lock.hcl

D.

A subdirectory of your configuration named .terraform

Buy Now
Questions 61

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 62

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

Buy Now
Questions 63

In a Terraform Cloud workpace linked to a version control repository speculative plan rum start automatically commit changes to version control.

Options:

A.

True

B.

False

Buy Now
Questions 64

Which Terraform collection type should you use to store key/value pairs?

Options:

A.

Set

B.

Map

C.

Tuple

D.

list

Buy Now
Questions 65

Your risk management organization requires that new AWS S3 buckets must be private and encrypted at rest. How can Terraform Cloud automatically and proactively enforce this security control?

Options:

A.

Auditing cloud storage buckets with a vulnerability scanning tool

B.

By adding variables to each Terraform Cloud workspace to ensure these settings are always enabled

C.

With an S3 module with proper settings for buckets

D.

With a Sentinel policy, which runs before every apply

Buy Now
Questions 66

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 67

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 68

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

Buy Now
Questions 69

What is the provider for the resource shown in the Exhibit?

resource "aws_vpc" "main" {

name = "test"

}

Options:

A.

VPC

B.

test

C.

main

D.

aws

Buy Now
Questions 70

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

Options:

A.

Tree

B.

Map

C.

List

D.

set

Buy Now
Questions 71

When you use a remote backend that needs authentication, HashiCorp recommends that you:

Options:

A.

Write the authentication credentials in the Terraform configuration files

B.

Keep the Terraform configuration files in a secret store

C.

Push your Terraform configuration to an encrypted git repository

D.

Use partial configuration to load the authentication credentials outside of the Terraform code

Buy Now
Questions 72

You can access state stored with the local backend by using terraform_remote_state data source.

Options:

A.

True

B.

False

Buy Now
Questions 73

Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?

Options:

A.

They can securely store cloud credentials.

B.

They have role-based access controls.

C.

Plans and applies can be triggered via version control system integrations.

D.

You must use the CLI to switch between workspaces.

Buy Now
Exam Name: HashiCorp Certified: Terraform Associate (003) (HCTA0-003)
Last Update: Oct 31, 2025
Questions: 248

PDF + Testing Engine

$63.52  $181.49

Testing Engine

$50.57  $144.49
buy now Terraform-Associate-003 testing engine

PDF (Q&A)

$43.57  $124.49
buy now Terraform-Associate-003 pdf