Month End Sale 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: clap70

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

Questions 4

Where in your Terraform configuration do you specify a state backend?

Options:

A.

The resource block

B.

The data source block

C.

The terraform block

D.

The provider block

Buy Now
Questions 5

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 6

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 7

You add a new provider to your configuration and immediately run terraform apply in the CD using the local backend. Why does the apply fail?

Options:

A.

The Terraform CD needs you to log into Terraform Cloud first

B.

Terraform requires you to manually run terraform plan first

C.

Terraform needs to install the necessary plugins first

D.

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

Buy Now
Questions 8

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

Buy Now
Questions 9

How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?

Options:

A.

Only Terraform Cloud organization owners can set workspace variables on VCS connected workspaces

B.

Commit a change to the VCS working directory and branch that the Terraform Cloud workspace is connected to

C.

Only Terraform Cloud organization owners can approve plans in VCS connected workspaces

D.

Only members of a VCS organization can open a pull request against repositories that are connected to Terraform Cloud workspaces

Buy Now
Questions 10

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 11

Which command lets you experiment with terraform expressions?

Options:

A.

Terraform console

B.

Terraform validate

C.

Terraform env

D.

Terraform test

Buy Now
Questions 12

Terraformrequiresthe Go runtime as a prerequisite for installation.

Options:

A.

True

B.

False

Buy Now
Questions 13

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

Buy Now
Questions 14

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

Options:

A.

True

B.

False

Buy Now
Questions 15

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 16

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 17

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 18

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

Options:

A.

True

B.

False

Buy Now
Questions 19

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 20

HashiCorp Configuration Language (HCL) supports user-denned functions.

Options:

A.

True

B.

False

Buy Now
Questions 21

terraform validate uses provider APIs to verify your infrastructure settings.

Options:

A.

True

B.

False

Buy Now
Questions 22

You cannot install third party plugins using terraform init.

Options:

A.

True

B.

False

Buy Now
Questions 23

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 24

You're writing a Terraform configuration that needs to read input from a local file called id_rsa.pub . Which built-in Terraform function can you use to import the file's contents as a string?

Options:

A.

file("id_rsa.pub")

B.

templaTefil("id_rsa.pub")

C.

filebase64("id_rsa.pub")

D.

fileset<"id_rsa.pub")

Buy Now
Questions 25

Which of the following is not true of Terraform providers?

Options:

A.

An individual person can write a Terraform Provider

B.

A community of users can maintain a provider

C.

HashiCorp maintains some providers

D.

Cloud providers and infrastructure vendors can write, maintain, or collaborate on Terraform

E.

providers

F.

None of the above

Buy Now
Questions 26

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 27

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 28

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 29

As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?

Options:

A.

terraform refresh -upgrade

B.

terraform apply -upgrade

C.

terraform init -upgrade

D.

terraform providers -upgrade

Buy Now
Questions 30

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

Buy Now
Questions 31

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 32

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 33

What is the name of the default file where Terraform stores the state?

Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.

Options:

Buy Now
Questions 34

What are some benefits of using Sentinel with Terraform Cloud/Terraform Cloud? Choose three correct answers.

Options:

A.

You can restrict specific resource configurations, such as disallowing the use of CIDR=0.0.0.0/0.

B.

You can check out and check in cloud access keys

C.

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

D.

Policy-as-code can enforce security best practices

E.

You can enforce a list of approved AWS AMIs

Buy Now
Questions 35

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

Buy Now
Questions 36

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

Options:

A.

True

B.

False

Buy Now
Questions 37

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

Buy Now
Questions 38

Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state files. How can you protect that data?

Options:

A.

Edit your state file to scrub out the sensitive data

B.

Always store your secrets in a secrets.tfvars file

C.

Delete the state file every time you run Terraform

D.

Store the state in an encrypted backend

Buy Now
Questions 39

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 40

Which Terraform command checks that your configuration syntax is correct?

Options:

A.

terraform validate

B.

terraform init

C.

terraform show

D.

terraform fmt

Buy Now
Questions 41

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 42

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
Questions 43

Terraform providers are always installed from the Internet.

Options:

A.

True

B.

False

Buy Now
Questions 44

When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?

Options:

A.

You can import infrastructure without corresponding Terraform code

B.

Terraform will generate the corresponding configuration files for you

C.

Before you run terraform Import

D.

After you run terraform import

Buy Now
Questions 45

_______backends support state locking.

Options:

A.

All

B.

No

C.

Some

D.

Only local

Buy Now
Questions 46

What functionality do providers offer in Terraform?(Pick 3 correct responses)

Options:

A.

Interact with cloud provider APIs.

B.

Provision resources for on-premises infrastructure services.

C.

Group a collection of Terraform configuration files that map to a single state file.

D.

Provision resources for public cloud infrastructure services.

E.

Enforce security and compliance policies.

Buy Now
Questions 47

If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?

Options:

A.

Run terraform refresh

B.

It will happen automatically

C.

Manually update the state fire

D.

Run terraform import

Buy Now
Questions 48

You have deployed a new webapp with a public IP address on a cloud provider. However, you did not create any outputs for your code. What is the best method to quickly find the IP address of the resource you deployed?

Options:

A.

In a new folder, use the terraform_remote_state data source to load in the state file, then write an output for each resource that you find the state file

B.

Run terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address

C.

Run terraform output ip_address to view the result

D.

Run terraform destroy then terraform apply and look for the IP address in stdout

Buy Now
Questions 49

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

Buy Now
Questions 50

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 51

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

Options:

A.

A web-based user interface (Ul)

B.

Automated infrastructure deployment visualization

C.

Automatic backups

D.

Remote state storage

Buy Now
Questions 52

A developer on your team is going lo leaf down an existing deployment managed by Terraform and deploy a new one. However, there is a server resource named aws instant.ubuntu[l] they would like to keep. What command should they use to tell Terraform to stop managing that specific resource?

Options:

A.

Terraform plan rm:aws_instance.ubuntu[1]

B.

Terraform state rm:aws_instance.ubuntu[1]

C.

Terraform apply rm:aws_instance.ubuntu[1]

D.

Terraform destory rm:aws_instance.ubuntu[1]

Buy Now
Questions 53

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 54

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 55

The public Terraform Module Registry is free to use.

Options:

A.

True

B.

False

Buy Now
Questions 56

A terraform apply can not _________ infrastructure.

Options:

A.

change

B.

destroy

C.

provision

D.

import

Buy Now
Questions 57

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 58

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

Buy Now
Questions 59

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 60

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 61

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

Buy Now
Questions 62

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 63

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 64

You can reference a resource created with for_each using a Splat ( *) expression.

Options:

A.

True

B.

False

Buy Now
Questions 65

A resource block is shown in the Exhibit section of this page. How would you reference the attribute name of this resource in HCL?

Options:

A.

resource.kubernetes_namespace.example.name

B.

kubernetes_namespace.example.name

C.

data.kubernetes.namespace.name

D.

kubernetes_namespace.test.name

Buy Now
Questions 66

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

Options:

A.

True

B.

False

Buy Now
Questions 67

Any user can publish modules to the public Terraform Module Registry.

Options:

A.

True

B.

False

Buy Now
Exam Name: HashiCorp Certified: Terraform Associate (003) (HCTA0-003)
Last Update: May 1, 2025
Questions: 226
Terraform-Associate-003 pdf

Terraform-Associate-003 PDF

$25.5  $84.99
Terraform-Associate-003 Engine

Terraform-Associate-003 Testing Engine

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

Terraform-Associate-003 PDF + Testing Engine

$40.5  $134.99