Spring Special Sale - 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: best70

Page: 1 / 10
Total 95 questions
Exam Code: Terraform-Associate-004                Update: Mar 21, 2026
Exam Name: HashiCorp Certified: Terraform Associate (004) (HCTA0-004)

HashiCorp HashiCorp Certified: Terraform Associate (004) (HCTA0-004) Terraform-Associate-004 Exam Dumps: Updated Questions & Answers (March 2026)

Question # 1

Your Terraform configuration declares a variable. You want to enforce that its value meets your specific requirements, and you want to block the Terraform operation if it does not. What should you add to your configuration?

A.

Add a top-level check block.

B.

Add a validation block to the variable block.

C.

Add a top-level validation block.

D.

Add a check block to the variable block.

Question # 2

What type of block is used to construct a collection of nested configuration blocks?

A.

Dynamic

B.

For_each

C.

Nesting

D.

repeated.

Question # 3

You much initialize your working directory before running terraform validate.

A.

True

B.

False

Question # 4

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

A.

resource.kubernetes_namespace.example.name

B.

kubernetes_namespace.example.name

C.

data.kubernetes.namespace.name

D.

kubernetes_namespace.test.name

Question # 5

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

A.

True

B.

False

Question # 6

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?

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question # 7

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?

A.

top(numcpus)

B.

max(numcpus)

C.

ceil (numcpus)

D.

hight[numcpus]

Question # 8

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

A.

version

B.

version = " 3.1 "

C.

version: 3.1

D.

version - 3.1

Question # 9

Exhibit:

resource " azurerm_linux_web_app " " app " {

name = " example-app "

resource_group_name = azurerm_resource_group.rg.name

location = azurerm_resource_group.rg.location

service_plan_id = azurerm_service_plan.plan.id

identity {

type = " UserAssigned "

identity_ids = [azurerm_user_assigned_identity.app.id]

}

}

resource " azurerm_role_assignment " " kv_access " {

scope = azurerm_key_vault.kv.id

role_definition_name = " Key Vault Secrets User "

principal_id = azurerm_user_assigned_identity.app.principal_id

}

Two resource blocks are shown: azurerm_linux_web_app and azurerm_role_assignment. When provisioned, the web app will use the role assignment during creation, so the role assignment must be created first. How do you ensure the azurerm_role_assignment resource is created first?

A.

Add a depends_on argument to the azurerm_linux_web_app.

B.

Add a create_before_destroy argument to the azurerm_role_assignment.

C.

Change the order of the azurerm_linux_web_app and azurerm_role_assignment blocks.

D.

Add a count argument to both resources.

Question # 10

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

A.

value

B.

description

C.

default

D.

sensitive

Page: 1 / 10
Total 95 questions

Most Popular Certification Exams

Payment

       

Contact us

Site Secure

mcafee secure

TESTED 21 Mar 2026