Summer Special Discount 60% Offer - Ends in 0d 00h 00m 00s - Coupon code: brite60

ExamsBrite Dumps

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

HashiCorp Certified: Terraform Associate (003) (HCTA0-003)

Last Update Oct 6, 2025
Total Questions : 248

We are offering FREE Terraform-Associate-003 HashiCorp exam questions. All you do is to just go and sign up. Give your details, prepare Terraform-Associate-003 free exam questions and then go for complete pool of HashiCorp Certified: Terraform Associate (003) (HCTA0-003) test questions that will help you more.

Terraform-Associate-003 pdf

Terraform-Associate-003 PDF

$42  $104.99
Terraform-Associate-003 Engine

Terraform-Associate-003 Testing Engine

$50  $124.99
Terraform-Associate-003 PDF + Engine

Terraform-Associate-003 PDF + Testing Engine

$66  $164.99
Questions 1

Which of the following can you do with terraform plan? (Pick 2 correct responses)

Options:

A.  

Schedule Terraform to run at a planned time in the future.

B.  

View the execution plan and check if the changes match your expectations.

C.  

Save a generated execution plan to apply later.

D.  

Execute a plan in a different workspace.

Discussion 0
Questions 2

Which of these are benefits of using Sentinel with HCP Terraform/Terraform Cloud? (Pick the 3 correct responses)

Options:

A.  

You can enforce a list of approved AWS AMIs.

B.  

Sentinel Policies can be written in HashiCorp Configuration Language (HCL).

C.  

You can check out and check in cloud access keys.

D.  

Policy-as-code can enforce security best practices.

Discussion 0
Questions 3

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

Discussion 0
Questions 4

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

Discussion 0
Questions 5

What is the workflow for deploying new infrastructure with Terraform?

Options:

A.  

Write Terraform configuration, run terraform init to initialize the working directory orworkspace, and run terraform apply

B.  

Write Terraform configuration, run terraform show to view proposed changes, and terraform apply to create new infrastructure

C.  

Write Terraform configuration, run terraform apply to create infrastructure, use terraform validate to confirm Terraform deployed resources correctly

D.  

Write Terraform configuration, run terraform plan to initialize the working directory or workspace, and terraform apply to create the infrastructure

Discussion 0
Questions 6

Terraform encrypts sensitive values stored in your state file.

Options:

A.  

True

B.  

False

Discussion 0
Questions 7

Which of the following should you add in the required_providers block to define a provider version constraint?

Options:

A.  

version

B.  

version = "3.1"

C.  

version: 3.1

D.  

version - 3.1

Discussion 0
Questions 8

You have a Terraform configuration that defines a single virtual machine with no references to it, You have run terraform apply to create the resource, and then removed the resource definition from your Terraform configuration file.

What will happen you run terraform apply in the working directory again?

Options:

A.  

Terraform will remove the virtual machine from the state file, but the resource will still exist

B.  

Nothing

C.  

Terraform will error

D.  

Terraform will destroy the virtual machine

Discussion 0
Questions 9

_______backends support state locking.

Options:

A.  

All

B.  

No

C.  

Some

D.  

Only local

Discussion 0
Questions 10

How would you reference the volume IDs associated with the ebs_block_device blocks in this configuration?

Options:

A.  

aws_instance.example.ebs_block_device[sda2,sda3).volume_id

B.  

aws_lnstance.example.ebs_block_device.[*].volume_id

C.  

aws_lnstance.example.ebs_block_device.volume_ids

D.  

aws_instance.example-ebs_block_device.*.volume_id

Discussion 0
Questions 11

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

Discussion 0
Questions 12

How would you output returned values from a child module in the Terraform CLI output?

Options:

A.  

Declare the output in the root configuration

B.  

Declare the output in the child module

C.  

Declare the output in both the root and child module

D.  

None of the above

Discussion 0
Questions 13

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.

Discussion 0
Questions 14

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

Discussion 0
Questions 15

Terraform configuration (including any module references) can contain only one Terraform provider type.

Options:

A.  

True

B.  

False

Discussion 0
Questions 16

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

Discussion 0
Questions 17

You want to define a single input variable to capture configuration values for a server. The values must represent memory as a number, and the server name as a string.

Which variable type could you use for this input?

Options:

A.  

List

B.  

Object

C.  

Map

D.  

Terraform does not support complex input variables of different types

Discussion 0
Questions 18

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

Discussion 0
Questions 19

Which command lets you experiment with terraform expressions?

Options:

A.  

Terraform console

B.  

Terraform validate

C.  

Terraform env

D.  

Terraform test

Discussion 0
Questions 20

Options:

A.  

Modify the Terraform configuration to add an import block for both of the virtual machines.

B.  

Run a terraform apply -refresh to identify the virtual machine IDs that are already managed by Terraform.

C.  

Run terraform state rm on both VMs, then terraform apply to recreate the correct one.

D.  

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.

Discussion 0
Questions 21

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

Discussion 0
Questions 22

A senior admin accidentally deleted some of your cloud instances. What will Terraform do when you run terraform apply?

Options:

A.  

Tear down the entire workspace's infrastructure and rebuild it.

B.  

Build a completely brand new set of infrastructure.

C.  

Rebuild only the instances that were deleted.

D.  

Stop and generate an error message about the missing instances.

Discussion 0
Questions 23

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 24

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

Discussion 0
Questions 25

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 26

What is the purpose of the terraform.lock.hcl file in Terraform?

Options:

A.  

There is no such file.

B.  

Storing references to workspaces, which are locked.

C.  

Preventing Terraform runs from occurring.

D.  

Tracking specific provider dependencies.

Discussion 0
Questions 27

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

Options:

A.  

With two spaces.

B.  

With four spaces.

C.  

With three spaces.

D.  

With a tab.

Discussion 0
Questions 28

What does the default "local" Terraform backend store?

Options:

A.  

tfplan files

B.  

State file

C.  

Provider plugins

D.  

Terraform binary

Discussion 0
Questions 29

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

Discussion 0
Questions 30

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

Discussion 0
Questions 31

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

Discussion 0
Questions 32

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.

Discussion 0
Questions 33

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 34

You are working on some new application features and you want to spin up a copy of your production deployment to perform some quick tests. In order to avoid having to configure a new state backend, what open source Terraform feature would allow you create multiple states but still be associated with your current code?

Options:

A.  

Terraform data sources

B.  

Terraform local values

C.  

Terraform modules

D.  

Terraform workspaces

E.  

None of the above

Discussion 0
Questions 35

You modified your Terraform configuration to fix a typo in the resource ID by renaming it from photoes to photos. What configuration will you add to update the resource ID in state without destroying the existing resource?

Original configuration:

resource "aws_s3_bucket" "photoes" {

bucket_prefix = "images"

}

Updated configuration:

resource "aws_s3_bucket" "photos" {

bucket_prefix = "images"

}

Options:

A.  

moved {

from = aws_s3_bucket.photoes

to = aws_s3_bucket.photos

}

B.  

moved {

bucket.photoes = aws_s3_bucket.photos

}

C.  

moved {

aws_s3_bucket.photoes = aws_s3_bucket.photos

}

D.  

None. Terraform will automatically update the resource I

D.  

Discussion 0
Questions 36

Terraform providers are always installed from the Internet.

Options:

A.  

True

B.  

False

Discussion 0
Questions 37

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

Discussion 0
Questions 38

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

Discussion 0
Questions 39

Terraform configuration can only import modules from the public registry.

Options:

A.  

True

B.  

False

Discussion 0
Questions 40

You've used Terraform to deploy a virtual machine and a database. You want to replace this virtual machine instance with an identical one without affecting the database. What is the best way to achieve this using Terraform?

Options:

A.  

Use the terraform state rm command to remove the VM from state file

B.  

Use the terraform taint command targeting the VMs then run terraform plan and terraform apply

C.  

Use the terraform apply command targeting the VM resources only

D.  

Delete the Terraform VM resources from your Terraform code then run terraform plan and terraform apply

Discussion 0
Questions 41

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 42

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

Discussion 0
Questions 43

Options:

A.  

data

B.  

local

C.  

resource

D.  

provider

Discussion 0
Questions 44

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

Discussion 0
Questions 45

Multiple team members are collaborating on infrastructure using Terraform and want to format the* Terraform code following standard Terraform-style convention.

How should they ensure the code satisfies conventions?

Options:

A.  

Terraform automatically formats configuration on terraform apply

B.  

Run terraform validate prior to executing terraform plan or terraform apply

C.  

Use terraform fmt

D.  

Replace all tabs with spaces

Discussion 0
Questions 46

Options:

A.  

version ~> 3.1

B.  

version >= 3.1

C.  

version = ">= 3.1"

Discussion 0
Questions 47

Which of the following is not a valid source path for specifying a module?

Options:

A.  

source - "github.com/hashicorp/examplePref-ul.0.8M

B.  

source = "./module?version=vl.6.0"

C.  

source - "hashicorp/consul/aws"

D.  

source - "./module"

Discussion 0
Questions 48

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 49

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}

Discussion 0
Questions 50

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

Options:

A.  

Set

B.  

Map

C.  

Tuple

D.  

list

Discussion 0
Questions 51

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.

Discussion 0
Questions 52

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 53

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 54

Which of these are features of HCP Terraform/Terraform Cloud? Pick the 2 correct responses below.

Options:

A.  

Automated infrastructure deployment visualization.

B.  

A web-based user interface (UI).

C.  

Automatic backups of configuration and state.

D.  

Remote state storage.

Discussion 0
Questions 55

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

Discussion 0
Questions 56

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

Discussion 0
Questions 57

If a DevOps team adopts AWS CloudFormation as their standardized method for provisioning public cloud resoruces, which of the following scenarios poses a challenge for this team?

Options:

A.  

The team is asked to manage a new application stack built on AWS-native services

B.  

The organization decides to expand into Azure wishes to deploy new infrastructure

C.  

The team is asked to build a reusable code based that can deploy resources into any AWS region

D.  

The DevOps team is tasked with automating a manual, web console-based provisioning.

Discussion 0
Questions 58

When you include a module block in your configuration that references a module from the Terraform Registry, the "version" attribute is required.

Options:

A.  

True

B.  

False

Discussion 0
Questions 59

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.

Discussion 0
Questions 60

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 61

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

Options:

A.  

list

B.  

array

C.  

nap

D.  

string

Discussion 0
Questions 62

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 63

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

Discussion 0
Questions 64

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 65

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.

Discussion 0
Questions 66

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

Discussion 0
Questions 67

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.

Discussion 0
Questions 68

Select the command that doesn’t cause Terraform to refresh its state.

Options:

A.  

Terraform destroy

B.  

Terraform apply

C.  

Terraform plan

D.  

Terraform state list

Discussion 0
Questions 69

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

Discussion 0
Questions 70

You are writing a child Terraform module that provisions an AWS instance. You want to reference the IP address returned by the child module in the root configuration. You name the instance resource "main'.

Which of these is the correct way to define the output value?

Options:

A.  

Option A

B.  

Option B

C.  

Option C

D.  

Option D

Discussion 0
Questions 71

You much initialize your working directory before running terraform validate.

Options:

A.  

True

B.  

False

Discussion 0
Questions 72

Why would you use the -replace flag for terraform apply?

Options:

A.  

You want Terraform to ignore a resource on the next apply

B.  

You want Terraform to destroy all the infrastructure in your workspace

C.  

You want to force Terraform to destroy a resource on the next apply

D.  

You want to force Terraform to destroy and recreate a resource on the next apply

Discussion 0
Questions 73

Which of the following statements about Terraform modules is not true?

Options:

A.  

Modules can call other modules

B.  

A module is a container for one or more resources

C.  

Modules must be publicly accessible

D.  

You can call the same module multiple times

Discussion 0
Questions 74

Which of the following module source paths does not specify a remote module?

Options:

A.  

Source = “module/consul’’

B.  

Source = ‘’githhub.comicrop/example’’

C.  

Source =’’git@github.com:hasicrop/example.git’’

D.  

Source = ‘’hasicrop/consul/aws’’

Discussion 0