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 Apr 15, 2026
Total Questions : 318

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

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

Discussion 0
Questions 2

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 3

Where in your Terraform configuration do you specify remote state storage settings?

Options:

A.  

The resource block

B.  

The provider block

C.  

The data block

D.  

The terraform block

Discussion 0
Questions 4

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 5

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 6

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

Discussion 0
Questions 7

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 8

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.

Discussion 0
Questions 9

Which of the following can you do with terraform plan?

Pick the two correct responses below.

Options:

A.  

Save a generated execution plan to apply later.

B.  

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

C.  

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

D.  

Execute a plan in a different workspace.

Discussion 0
Questions 10

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

Discussion 0
Questions 11

Which parameters does the import block require? (Pick the 2 correct responses below.)

Options:

A.  

The resource ID

B.  

Provider

C.  

The target resource address

D.  

Backend

Discussion 0
Questions 12

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

Discussion 0
Questions 13

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

Discussion 0
Questions 14

The terraform output command shows outputs from child modules.

Options:

A.  

True

B.  

False

Discussion 0
Questions 15

Which is a benefit of using infrastructure as code (IaC) tools compared to native platform APIs?

Options:

A.  

IaC allows you to write each API call required to reach the desired configuration.

B.  

IaC calls native command line tools, which are more efficient than API calls.

C.  

IaC configurations define the current state of infrastructure, which allows you to identify the correct API calls to make changes.

D.  

IaC configurations define the end state of the infrastructure without having to write API calls to reach the desired configuration.

Discussion 0
Questions 16

You corrected a typo in a resource name, changing it from aws_s3_bucket.photoes to aws_s3_bucket.photos. You want to update the Terraform state so that the existing resource is recognized under the new name, without destroying and recreating it. Which configuration should you use?

Options:

A.  

Remove the old resource from your configuration and re-import it.

B.  

Run terraform apply -refresh-only.

C.  

Do nothing — Terraform will automatically update the state.

D.  

Add a moved block to your configuration.

Discussion 0
Questions 17

What command can you run to generateDOT (Graphviz)formatted data to visualize Terraform dependencies?

Options:

A.  

terraform refresh

B.  

terraform graph

C.  

terraform output

D.  

terraform show

Discussion 0
Questions 18

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 19

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 20

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

Discussion 0
Questions 21

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 22

You want to create a string that combines a generated random_id and a variable and reuse that string several times in your configuration. What is the simplest correct way to implement this without repeating the random_id and variable?

Options:

A.  

Use a module.

B.  

Add an output value.

C.  

Add a local value.

D.  

Use a data source.

Discussion 0
Questions 23

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

Discussion 0
Questions 24

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 25

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

Discussion 0
Questions 26

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 27

In Terraform HCL, an object type of object({name=string, age-number}) would match this value.

Options:

A.  

Option A

B.  

Option B

C.  

Option C

D.  

Option D

Discussion 0
Questions 28

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 29

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

Discussion 0
Questions 30

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 31

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 32

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 33

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 34

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

Options:

A.  

chomp

B.  

join

C.  

slice

D.  

split

Discussion 0
Questions 35

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?

Options:

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.

Discussion 0
Questions 36

Which argument can you set on a module block to prevent Terraform from updating the module’s configuration during an init or get operation?

Options:

A.  

version

B.  

lifecycle

C.  

count

D.  

source

Discussion 0
Questions 37

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

Discussion 0
Questions 38

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 39

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 40

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 41

A developer launched a VM outside of the Terraform workflow and ended up with two servers with the same name. They are unsure which VM is managed with Terraform, but they do have a list of all active VM IDs. Which method could you use to determine which instance Terraform manages?

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 42

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 43

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 44

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 45

What feature stops multiple users from operating on the Terraform state at the same time?

Options:

A.  

State locking

B.  

Version control

C.  

Provider constraints

D.  

Remote backends

Discussion 0
Questions 46

Terraformrequiresthe Go runtime as a prerequisite for installation.

Options:

A.  

True

B.  

False

Discussion 0
Questions 47

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 48

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 49

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

Discussion 0
Questions 50

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

Discussion 0
Questions 51

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 52

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 53

Terraform providers are part of the Terraform core binary.

Options:

A.  

True

B.  

False

Discussion 0
Questions 54

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 55

When you initialize Terraform, where does it cache modules from the public Terraform Registry?

Options:

A.  

In the /tmp directory.

B.  

In the .terraform sub-directory.

C.  

In memory.

D.  

They are not cached.

Discussion 0
Questions 56

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 57

Your team is using version 3.1.4 of a module from the public Terraform Registry, and they are worried about possible breaking changes in future versions of the module. Which version argument should you add to the module block to prevent newer versions from being used?

Options:

A.  

version = " < 3.2 "

B.  

version = " > = 3.1.5 "

C.  

version = " 3.1.4 "

D.  

version = " ~ > 3.1.4 "

Discussion 0
Questions 58

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 59

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 60

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 61

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 62

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 63

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 64

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 65

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 66

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)

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 67

Exhibit:

Root module configuration:

output " vnet_id " {

value = module.my_network.vnet_id

}

Error:

Error: Reference to undeclared output value

on main.tf line 12, in output " vnet_id " :

12: value = module.my_network.vnet_id

You are using a networking module in your Terraform configuration with the name my_network. Your root module includes the configuration shown. When you run terraform validate, you get the error shown. Which option would successfully retrieve this value from your networking module?

Options:

A.  

Change the referenced value to module.my_network.outputs.vnet_id.

B.  

Define the attribute vnet_id as a variable in the networking module.

C.  

Change the referenced value to my_network.outputs.vnet_id.

D.  

Define the attribute vnet_id as an output in the networking module.

Discussion 0
Questions 68

_______backends support state locking.

Options:

A.  

All

B.  

No

C.  

Some

D.  

Only local

Discussion 0
Questions 69

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 70

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 71

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 72

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.photoesto = 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 73

What is an advantage of immutable infrastructure?

Options:

A.  

In-place infrastructure upgrades

B.  

Quicker infrastructure upgrades

C.  

Automatic infrastructure upgrades

D.  

Less complex infrastructure upgrades

Discussion 0
Questions 74

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

Discussion 0
Questions 75

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 76

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 77

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.  

fileset( " id_rsa.pub " )

B.  

file( " id_rsa.pub " )

C.  

filebase64( " id_rsa.pub " )

D.  

templatefile( " id_rsa.pub " )

Discussion 0
Questions 78

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

Options:

A.  

True

B.  

False

Discussion 0
Questions 79

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 80

How does the Terraform cloud integration differ from other state backends such as S3, Consul,etc?

Options:

A.  

It can execute Terraform runs on dedicated infrastructure in Terraform Cloud

B.  

It doesn ' t show the output of a terraform apply locally

C.  

It is only arable lo paying customers

D.  

All of the above

Discussion 0
Questions 81

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

Options:

A.  

terraform destroy

B.  

All of these will trigger terraform destroy

C.  

terraform plan -destroy

D.  

terraform destroy -auto-approve

Discussion 0
Questions 82

You created infrastructure outside the Terraform workflow that you now want to manage using Terraform. Which command brings the infrastructure into Terraform state?

Options:

A.  

terraform get

B.  

terraform refresh

C.  

terraform import

D.  

terraform init

Discussion 0
Questions 83

When does Terraform create the .terraform.lock.hc1 file?

Options:

A.  

After your first terraform plan

B.  

After your first terraform apply

C.  

After your first terraform init

D.  

When you enable state locking

Discussion 0
Questions 84

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 85

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

Discussion 0
Questions 86

What is terraform plan -refresh-only intended to detect?

Options:

A.  

Terraform configuration code changes

B.  

Corrupt state files

C.  

State file drift

D.  

Empty state files

Discussion 0
Questions 87

What is one disadvantage of using dynamic blocks in Terraform?

Options:

A.  

Dynamic blocks can construct repeatable nested blocks

B.  

Terraform will run more slowly

C.  

They cannot be used to loop through a list of values

D.  

They make configuration harder to read and understand

Discussion 0
Questions 88

A terraform apply can not _________ infrastructure.

Options:

A.  

change

B.  

destroy

C.  

provision

D.  

import

Discussion 0
Questions 89

A resource block is shown in the Exhibit space of this page. How would you reference the name value of the second instance of this resource?

Options:

A.  

aws_instance.web[2].name

B.  

aws_instance.web.*.name

C.  

aws_instance.web[l].name

D.  

aws_instance.web[l]

E.  

element(aws_instance.web, 2)

Discussion 0
Questions 90

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 91

Your team adopts AWS CloudFormation as the standardized method for provisioning public cloud resources. Which scenario presents a challenge for your team?

Options:

A.  

Building a reusable code base that can deploy resources into any AWS region.

B.  

Managing a new application stack built on AWS-native services.

C.  

Automating a manual, web console-based provisioning process.

D.  

Deploying new infrastructure into Microsoft Azure.

Discussion 0
Questions 92

Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?

Options:

A.  

terraform fmt -write-false

B.  

terraform fmt -list -recursive

C.  

terraform fmt -check -recursive

D.  

terraform fmt -check

Discussion 0
Questions 93

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 94

Which of the following is not an action performed by terraform init?

Options:

A.  

Initialize a configured backend.

B.  

Create template configuration files.

C.  

Load required provider plugins.

D.  

Retrieve the source code for all referenced modules.

Discussion 0
Questions 95

The HCP Terraform private registry keeps the module configurations confidential within your organization.

Options:

A.  

True

B.  

False

Discussion 0