Pre-Summer Sale 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: exams65

ExamsBrite Dumps

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

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

Last Update May 31, 2026
Total Questions : 359

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

Terraform-Associate-004 pdf

Terraform-Associate-004 PDF

$36.75  $104.99
Terraform-Associate-004 Engine

Terraform-Associate-004 Testing Engine

$43.75  $124.99
Terraform-Associate-004 PDF + Engine

Terraform-Associate-004 PDF + Testing Engine

$57.75  $164.99
Questions 1

Which situation will return an error when you run terraform validate?

Options:

A.  

The state file does not match the current infrastructure.

B.  

The code contains tabs for indentation instead of spaces.

C.  

There is a missing variable block.

D.  

None of these will return an error.

Discussion 0
Questions 2

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 3

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 4

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

Options:

A.  

Prevents manual modifications to your resources

B.  

Lets you version, reuse, and share infrastructure configuration

C.  

Secures your credentials

D.  

Provisions the same resources at a lower cost

E.  

Reduces risk of operator error

Discussion 0
Questions 5

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 6

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

Discussion 0
Questions 7

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 8

terraform destroy is the only way to remove infrastructure with Terraform.

Options:

A.  

True

B.  

False

Discussion 0
Questions 9

Terraform providers are always installed from the Internet.

Options:

A.  

True

B.  

False

Discussion 0
Questions 10

Exhibit:

resource " kubernetes_namespace " " example " {

name = " test "

}

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

Options:

A.  

kubernetes_namespace.example,name

B.  

kubernetes_namespace.test.name

C.  

data.kubernetes_namespace.name

D.  

resource.kubernetes_namespace.example.name

Discussion 0
Questions 11

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

Discussion 0
Questions 12

Which statement describes a goal of Infrastructure as Code (IaC)?

Options:

A.  

A pipeline process to test and deliver software.

B.  

Write once, run anywhere.

C.  

The programmatic configuration of resources.

D.  

Defining a vendor-agnostic API.

Discussion 0
Questions 13

Exhibit:

data " aws_ami " " web " {

most_recent = true

owners = [ " self " ]

tags = {

Name = " web-server "

}

}

A data source is shown in the exhibit. How do you reference the id attribute of this data source?

Options:

A.  

aws_ami.web.id

B.  

web.id

C.  

data.aws_ami.web.id

D.  

data.web.id

Discussion 0
Questions 14

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

Discussion 0
Questions 15

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 16

You are updating a child module with the resource block shown in the exhibit below. The public_ip attribute of the resource needs to be accessible to the parent module.

Exhibit:

resource " aws_instance " " example " {

ami = " ami-0a123456789abcdef "

instance_type = " t3.micro "

}

How do you meet this requirement?

Options:

A.  

Create a local value in the child module.

B.  

Create an output in the child module.

C.  

Add a data source to the parent module.

D.  

Add an import block to the parent module.

Discussion 0
Questions 17

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.

Discussion 0
Questions 18

You’ve updated your Terraform configuration, and you need to preview the proposed changes to your infrastructure. Which command should you run?

Options:

A.  

terraform show

B.  

terraform plan

C.  

terraform validate

D.  

terraform get

Discussion 0
Questions 19

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

Discussion 0
Questions 20

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.

Discussion 0
Questions 21

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

Discussion 0
Questions 22

How does the use of Infrastructure as Code (IaC) enhance the reliability of your infrastructure?

Pick the two correct responses below.

Options:

A.  

Proposed changes can be reviewed before being applied.

B.  

Infrastructure is automatically scaled to meet demand.

C.  

Incorrect configurations cannot be deployed.

D.  

Updates are deployed with zero downtime.

E.  

Configuration drift is reduced with declarative definitions.

Discussion 0
Questions 23

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 24

When a check block’s assertion fails, Terraform blocks the current operation from executing.

Options:

A.  

True

B.  

False

Discussion 0
Questions 25

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

Options:

A.  

Tree

B.  

Map

C.  

List

D.  

set

Discussion 0
Questions 26

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

Options:

A.  

chomp

B.  

join

C.  

slice

D.  

split

Discussion 0
Questions 27

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 28

After creating a new Terraform configuration, your configuration passes terraform validate but returns an “Access Denied” error from the cloud provider when running terraform plan.

Why did terraform validate not catch this issue?

Options:

A.  

Variables are only applied and validated during terraform plan, so terraform validate assumed defaults and returned a success message.

B.  

The working directory was not initialized, so the cloud provider plugin was unavailable when running the terraform validate command.

C.  

terraform validate only checks whether a configuration is syntactically correct and internally consistent, and it does not communicate with providers.

D.  

The remote backend was not configured, so terraform validate could not load the state and detect the missing credentials.

Discussion 0
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

Discussion 0
Questions 30

Only the user that generated a terraform plan may apply it.

Options:

A.  

True

B.  

False

Discussion 0
Questions 31

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 32

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 33

A module block is shown in the Exhibit space of this page. When you use a module block to reference a module from the Terraform Registry such as the one in the example, how do you specify version 1.0.0 of the module?

Options:

A.  

Append ?ref=v1.0.0 argument to the source path.

B.  

You cannot. Modules stored on the public Terraform Registry do not support versioning.

C.  

Add a version = " 1.0.0 " attribute to the module block.

D.  

Nothing. Modules stored on the public Terraform module Registry always default to version 1.0.0.

Discussion 0
Questions 34

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.

Discussion 0
Questions 35

Which of these actions will prevent two Terraform runs from changing the same state file at the same time?

Options:

A.  

Refresh the state after running Terraform

B.  

Delete the state before running Terraform

C.  

Configure state locking for your state backend

D.  

Run Terraform with parallelism set to 1

Discussion 0
Questions 36

You are using a networking module in your Terraform configuration with the name label my-network. In your main configuration you have the following code:

When you run terraform validate, you get the following error:

What must you do to successfully retrieve this value from your networking module?

Options:

A.  

Change the reference value to my-network,outputs,vmet_id

B.  

Define the attribute vmet_id as a variable in the networking modeule

C.  

Define the attribute vnet_id as an output in the networking module

D.  

Change the reference value module.my,network,outputs,vnet_id

Discussion 0
Questions 37

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 38

Which syntax check returns an error when you run terraform validate?

Options:

A.  

The state file does not match the current infrastructure.

B.  

The code contains tabs for indentation instead of spaces.

C.  

There is a missing variable block.

D.  

None of these will return an error.

Discussion 0
Questions 39

You can configure multiple cloud blocks in your Terraform configuration to connect your workspace to both HCP Terraform and your Terraform Enterprise instance.

Options:

A.  

True

B.  

False

Discussion 0
Questions 40

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 41

Exhibit:

Error: Saved plan is stale

The given plan file can no longer be applied because the state was changed by another operation after the plan was created.

You have a saved execution plan containing desired changes for infrastructure managed by Terraform. After running terraform apply my.tfplan, you receive the error shown. How can you apply the desired changes? (Pick the 2 correct responses below.)

Options:

A.  

Generate a new execution plan file with terraform plan, and apply the new plan.

B.  

Run terraform apply without the saved execution plan.

C.  

Force the apply command by adding the flag -lock=false.

D.  

Refresh the current state data using the -refresh-only flag.

E.  

Update the current plan file using the terraform state push command.

Discussion 0
Questions 42

You have created a main.tf Terraform configuration consisting of an application server, a database and a load balanced. You ran terraform apply and Terraform created all of the resources successfully.

Now you realize that you do not actually need the load balancer, so you run terraform destroy without any flags. What will happen?

Options:

A.  

Terraform will prompt you to pick which resource you want to destroy

B.  

Terraform will destroy the application server because it is listed first in the code

C.  

Terraform will prompt you to confirm that you want to destroy all the infrastructure

D.  

Terraform will destroy the main, tf file

E.  

Terraform will immediately destroy all the infrastructure

Discussion 0
Questions 43

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.

Discussion 0
Questions 44

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 45

You ate creating a Terraform configuration which needs to make use of multiple providers, one for AWS and one for Datadog. Which of the following provider blocks would allow you to do this?

Options:

A.  

Option A

B.  

Option B

C.  

Option C

Discussion 0
Questions 46

Which of the following is availableonlyinHCP Terraform workspacesandnot in Terraform CLI?

Options:

A.  

Dry runs with terraform plan.

B.  

Secure variable storage.

C.  

Using one workspace ' s state as a data source for another.

D.  

Support for multiple cloud providers.

Discussion 0
Questions 47

The Terraform binary version and provider versions must match each other in a single configuration.

Options:

A.  

True

B.  

False

Discussion 0
Questions 48

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.

Discussion 0
Questions 49

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 50

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.

Discussion 0
Questions 51

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 3 correct responses)

Options:

A.  

In a plaintext document on a shared drive.

B.  

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

C.  

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

D.  

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

E.  

In HashiCorp Vault.

Discussion 0
Questions 52

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 53

_______backends support state locking.

Options:

A.  

All

B.  

No

C.  

Some

D.  

Only local

Discussion 0
Questions 54

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

Discussion 0
Questions 55

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 56

You manage two workspaces in your HCP Terraform organization. The first workspace manages your network configuration. The second workspace manages your compute resources and retrieves values from the networking workspace.

What HCP Terraform feature lets you run an apply operation on the compute workspace every time you update the networking workspace?

Options:

A.  

Run triggers

B.  

Policy

C.  

Run tasks

D.  

Projects

Discussion 0
Questions 57

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 " )

Discussion 0
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

Discussion 0
Questions 59

You’ve just finished refactoring part of your Terraform workspace’s configuration to use a module to manage some of your resources. When you plan your changes, you notice that Terraform will destroy and recreate the affected resources. Doing so could cause unintended downtime in the application your workspace manages. What supported approach should you take to complete the refactor without destroying and recreating your resources?

Options:

A.  

Add moved blocks to your configuration to let Terraform know the new resource addresses for the affected resources.

B.  

Run the terraform console command to edit your workspace ' s state and update the resource names.

C.  

Manually edit your terraform.tfstate file and update the resource names.

D.  

Open your cloud provider ' s console and rename the affected resources.

Discussion 0
Questions 60

You have developed a new cloud-based service that uses proprietary APIs and want to use Terraform to create, manage, and delete users from the service. How can Terraform interact with the service?

Options:

A.  

Terraform can manage users for any service that is hosted on a public cloud provider.

B.  

Develop and publish a custom provider to interact with the service using its proprietary APIs.

Discussion 0
Questions 61

You need to destroy all of the resources in your Terraform workspace, except for aws_instance.ubuntu[1], which you want to keep. How can you tell Terraform to stop managing that specific resource without destroying it?

Options:

A.  

Remove the resource block from your configuration.

B.  

Change the value of the count argument on the resource.

C.  

Run terraform state rm aws_instance.ubuntu[1].

D.  

Use a moved block.

Discussion 0
Questions 62

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 }

Discussion 0
Questions 63

You are creating a reusable Terraform configuration and want to include an optional billing_dept tag so your Finance team can track team-specific spending on resources. Which of the following billing_dept variable declarations will achieve this?

Options:

A.  

variable " billing_dept " {default = " " }

B.  

variable " billing_dept " {optional = true}

C.  

variable " billing_dept " {type = optional(string)}

D.  

variable " billing_dept " {type = default}

Discussion 0
Questions 64

Which of these actions are forbidden when the Terraform state file is locked? (Pick the 3 correct responses)

Options:

A.  

terraform apply

B.  

terraform state list

C.  

terraform destroy

D.  

terraform fmt

Discussion 0
Questions 65

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 66

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

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 68

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 69

Which Terraform command checks that your configuration syntax is correct?

Options:

A.  

terraform validate

B.  

terraform init

C.  

terraform show

D.  

terraform fmt

Discussion 0
Questions 70

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

Options:

A.  

Run all Terraform commands on a shared server or container.

B.  

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

C.  

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

D.  

None of the above.

Discussion 0
Questions 71

How can you configure a Terraform workspace to store its state remotely?

Options:

A.  

Add a cloud block inside the terraform block.

B.  

Add a backend block inside the terraform block.

C.  

Set the TERAFORM_CLOUD environment variable.

D.  

Set the TERRAFORM_BACKEND environment variable.

Discussion 0
Questions 72

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.

Discussion 0
Questions 73

Terraform requires using a different provider for each cloud provider where you want to deploy resources.

Options:

A.  

True

B.  

False

Discussion 0
Questions 74

How do you specify a module’s version when publishing it to the public terraform Module Registry?

Options:

A.  

Configuration it in the module ' s Terraform code

B.  

Mention it on the module ' s configuration page on the Terraform Module Registry

C.  

The Terraform Module Registry does not support versioning modules

D.  

Tag a release in the associated repo

Discussion 0
Questions 75

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 76

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

Discussion 0
Questions 77

Exhibit.

You need to deploy resources into two different regions in the same Terraform configuration. To do this, you declare multiple provider configurations as shown in the Exhibit space on this page.

What meta-argument do you need to configure in a resource block to deploy the resource to the us-west-2 AWS region?

Options:

A.  

provider = aws.west

B.  

alias = aws.west

C.  

provider = west

D.  

alias = west

Discussion 0
Questions 78

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 79

terraform plan updates your state file.

Options:

A.  

True

B.  

False

Discussion 0
Questions 80

If one of your modules uses a local value, you can expose that value to callers of the module by defining a Terraform output in the module’s configuration.

Options:

A.  

True

B.  

False

Discussion 0
Questions 81

Which command doesnotcause Terraform to refresh its state?

Options:

A.  

terraform state list

B.  

terraform plan

C.  

terraform apply

D.  

terraform destroy

Discussion 0
Questions 82

Which command must you run before you run a plan or apply for the first time?

Options:

A.  

terraform init

B.  

terraform workspace

C.  

terraform validate

D.  

terraform import

Discussion 0
Questions 83

Terraform encrypts sensitive values stored in your state file.

Options:

A.  

True

B.  

False

Discussion 0
Questions 84

Which of these are features of HCP Terraform/Terraform Cloud? (Pick the 2 correct responses)

Options:

A.  

Automatic backups of configuration and state.

B.  

Remote state storage.

C.  

Automated infrastructure deployment visualization.

D.  

A web-based user interface (UI).

Discussion 0
Questions 85

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

Discussion 0
Questions 86

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

Discussion 0
Questions 87

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 88

One cloud block always maps to a single HCP Terraform/Terraform Cloud workspace.

Options:

A.  

True

B.  

False

Discussion 0
Questions 89

Which are forbidden actions when the terraform state file is locked? Choose three correct answers.

Options:

A.  

Terraform state list

B.  

Terraform destroy

C.  

Terraform validate

D.  

Terraform validate

E.  

Terraform for

F.  

Terraform apply

Discussion 0
Questions 90

You want to bring an existing database under Terraform management. What information is required to create a new import block for the database?

Pick the 2 correct responses below:

Options:

A.  

The destination resource address of the block that will manage the database.

B.  

The path to the .tf file that contains the database resource block.

C.  

The ID associated with the current database on the cloud provider.

D.  

The database platform and version that the existing resource is running.

E.  

The connection string that Terraform will use to connect and manage the database.

Discussion 0
Questions 91

You have a list of numbers that represents the number of free CPU cores on each virtual cluster:

numcpus = [ 18, 3, 7, 11, 2 ]

What Terraform function could you use to select the largest number from the list?

Options:

A.  

top(numcpus)

B.  

max(numcpus)

C.  

ceil (numcpus)

D.  

hight[numcpus]

Discussion 0
Questions 92

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

Options:

A.  

terraform state list ‘provider_type.name’

B.  

terraform state show ‘provider_type.name’

C.  

terraform get ‘provider_type.name’

D.  

terraform state list

Discussion 0
Questions 93

Where does HashiCorp recommend you store API tokens and other secrets within your team ' s Terraform workspaces?

Pick three correct responses below:

Options:

A.  

In a plaintext document on a shared drive.

B.  

In HashiCorp Vault.

C.  

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

D.  

In an environment variable and referenced with TF_VAR_variablename.

E.  

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

Discussion 0
Questions 94

The Terraform configuration shown in the Exhibit space on this page v/ill create a new AWS instance.

Options:

A.  

True

B.  

False

Discussion 0
Questions 95

When you run terraform apply -refresh-only, which of the following is not consulted by Terraform to update the state file?

Options:

A.  

Terraform configuration files defining the resources.

B.  

Authentication credentials for the provider.

C.  

The most recent state file.

D.  

The actual infrastructure as reported by the provider API.

Discussion 0
Questions 96

You need to deploy resources into two different regions in the same Terraform configuration using the block shown in the exhibit below.

What do you need to add to the provider configuration to deploy the resource to the us-west-2 AWS region?

Options:

A.  

B.  

B.  

C.  

C.  

D.  

D.  

Discussion 0
Questions 97

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

Discussion 0
Questions 98

Which is a benefit of the Terraform state file?

Options:

A.  

A state file can schedule recurring infrastructure tasks.

B.  

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

C.  

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

D.  

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

Discussion 0
Questions 99

The_________determines how Terraform creates, updates, or delete resources.

Options:

A.  

Terraform configuration

B.  

Terraform provisioner

C.  

Terraform provider

D.  

Terraform core

Discussion 0
Questions 100

Exhibit:

data " vsphere_datacenter " " dc " {}

resource " vsphere_folder " " parent " {

path = " Production "

type = " vm "

datacenter_id = _________

}

You want to pass the id of the vsphere_datacenter data source to the datacenter_id argument of the vsphere_folder resource. Which reference would you use?

Options:

A.  

data.vsphere_datacenter.de.id

B.  

vsphere_datacenter.dc.id

C.  

data.vsphere_datacenter.dc

D.  

data.de.id

Discussion 0
Questions 101

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 102

Exhibit:

variable " sizes " {

type = list(string)

description = " Valid server sizes "

default = [ " small " , " medium " , " large " ]

}

A variable declaration is shown in the exhibit. Which is the correct way to get the value of medium from this variable?

Options:

A.  

var.sizes[0]

B.  

var.sizes[1]

C.  

var.sizes[2]

D.  

var.sizes[3]

Discussion 0
Questions 103

Terraform stores the value of an output in its state file, even if the sensitive argument is set to true.

Options:

A.  

True

B.  

False

Discussion 0
Questions 104

What information does the public Terraform Module Registry automatically expose about published modules?

Options:

A.  

Required input variables

B.  

Optional inputs variables and default values

C.  

Outputs

D.  

All of the above

E.  

None of the above

Discussion 0
Questions 105

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 106

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