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

HashiCorp Terraform-Associate-004 Dumps

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

Question 1

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

Question 2

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

Options:

A.

True

B.

False

Question 3

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

Question 4

What does state looking accomplish?

Options:

A.

Prevent accidental Prevent accident deletion of the state file

B.

Blocks Terraform commands from modifying, the state file

C.

Copies the state file from memory to disk

D.

Encrypts any credentials stored within the state file

Question 5

Module variable assignments are inherited from the parent module and you do not need to explicitly set them.

Options:

A.

True

B.

False

Question 6

Exhibit.

as

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

Question 7

Terraform installs its providers during which phase?

Options:

A.

Plan

B.

Init

C.

Refresh

D.

All of the above

Question 8

How does Terraform determine dependencies between resources?

Options:

A.

Terraform requires resource dependencies to be defined as modules and sourced in order

B.

Terraform automatically builds a resource graph based on resources provisioners, special meta-parameters, and the stale file (if present}

C.

Terraform requires resources in a configuration to be listed m the order they will be created to determine dependencies

D.

Terraform requires all dependencies between resources to be specified using the depends_on parameter

Question 9

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

Options:

A.

True

B.

False

Question 10

Which type of block fetches or computes information for use elsewhere in a Terraform configuration?

Options:

A.

data

B.

local

C.

resource

D.

provider

Question 11

A module can always refer to all variables declared in its parent module.

Options:

A.

True

B.

False

Question 12

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

Options:

A.

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

B.

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

C.

Save a generated execution plan to apply later.

D.

Execute a plan in a different workspace.

Question 13

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

Question 14

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

Options:

A.

True

B.

False

Question 15

Which of these commands makes your code more human readable?

Options:

A.

Terraform validate

B.

Terraform output

C.

Terraform show

D.

Terraform file

Question 16

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.

Question 17

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

Question 18

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

Question 19

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

Options:

A.

True

B.

False

Question 20

What does Terraform not reference when running a terraform apply -refresh-only ?

Options:

A.

State file

B.

Credentials

C.

Cloud provider

D.

Terraform resource definitions in configuration files

Question 21

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

Options:

A.

True

B.

False

Question 22

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.

Question 23

Running terraform fmt without any flags in a directory with Terraform configuration files will check the formatting of those files, but will never change their contents.

Options:

A.

True

B.

False

Question 24

Which command doesnotcause Terraform to refresh its state?

Options:

A.

terraform state list

B.

terraform plan

C.

terraform apply

D.

terraform destroy

Question 25

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

Options:

A.

True

B.

False

Question 26

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.

Question 27

What type of information can be found on the Terraform Registry when using published modules?

Options:

A.

Required input variables.

B.

Outputs.

C.

Optional input variables and default values.

D.

All of the above.

Question 28

You used Terraform to create an ephemeral development environment in the cloud and are now ready to destroy all the infrastructure described by your Terraform configuration. To be safe, you would like to first see all the infrastructure that Terraform will delete.

Which command should you use to show all the resources that will be deleted? (Pick the 2 correct responses)

Options:

A.

Runterraform destroy. This will output all the resources that will be deleted before prompting for approval.

B.

Runterraform show -destroy.

C.

Runterraform state rm *.

Question 29

Why does this backend configuration not follow best practices?

as

Options:

A.

An alias meta-argument should be included in backend blocks whenever possible

B.

You should use the local enhanced storage backend whenever possible

C.

You should not store credentials in Terraform configuration

D.

The backend configuration should contain multiple credentials so that more than one user can execute terraform plan and terraform apply

Question 30

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?

A)

as

B)

C)

D)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 31

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

Options:

A.

True

B.

False

Question 32

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

Question 33

as

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)

Question 34

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

Options:

A.

There is no such file.

B.

Storing references to workspaces, which are locked.

C.

Preventing Terraform runs from occurring.

D.

Tracking specific provider dependencies.

Question 35

Which parameters does terraform import require? Choose two correct answers.

Options:

A.

Provider

B.

Resource ID

C.

Resource address

D.

Path

Question 36

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

Question 37

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:

Question 38

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

Question 39

Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.

Options:

A.

A variable file

B.

Defined in Environment variables

C.

Inside the backend block within the Terraform configuration

D.

Defined in a connection configuration outside of Terraform

Question 40

Only the user that generated a plan may apply it.

Options:

A.

True

B.

False

Question 41

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

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

Options:

A.

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

B.

Nothing

C.

Terraform will error

D.

Terraform will destroy the virtual machine

Question 42

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

Question 43

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

Question 44

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

Options:

A.

True

B.

False

Question 45

Terraform providers are part of the Terraform core binary.

Options:

A.

True

B.

False

Question 46

You cannot install third party plugins using terraform init.

Options:

A.

True

B.

False

Question 47

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

Options:

A.

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

B.

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

C.

Use the terraform apply command targeting the VM resources only

D.

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

Question 48

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

Question 49

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.

Question 50

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

Question 51

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.

Question 52

Where can Terraform not load a provider from?

Options:

A.

Plugins directory

B.

Provider plugin chance

C.

Official HashCrop Distribution on releases.hashcrop.com

D.

Source code

Question 53

You much initialize your working directory before running terraform validate.

Options:

A.

True

B.

False

Question 54

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

Question 55

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

Question 56

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

Options:

A.

True

B.

False

Question 57

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

Options:

A.

True

B.

False

Question 58

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

Question 59

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

Options:

A.

True

B.

False

Question 60

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

Options:

A.

True

B.

False

Question 61

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

Options:

A.

True

B.

False

Question 62

terraform validate confirms the syntax of Terraform files.

Options:

A.

True

B.

False

Question 63

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

Question 64

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

Question 65

Your DevOps team is currently using the local backend for your Terraform configuration. You would like to move to a remote backend to store the state file in a central location. Which of the following backends would not work?

Options:

A.

Artifactory

B.

Amazon S3

C.

Terraform Cloud

D.

Git

Question 66

How could you reference an attribute from the vsphere_datacenter data source for use with the datacenter_id argument within the vsphere_folder resource in the following configuration?

Options:

A.

Data.vsphere_datacenter.DC.id

B.

Vsphere_datacenter.dc.id

C.

Data,dc,id

D.

Data.vsphere_datacenter,dc

Question 67

Which Terraform command checks that your configuration syntax is correct?

Options:

A.

terraform validate

B.

terraform init

C.

terraform show

D.

terraform fmt

Question 68

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

Options:

A.

True

B.

False

Question 69

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

Question 70

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.

Question 71

What does the default "local" Terraform backend store?

Options:

A.

tfplan files

B.

State file

C.

Provider plugins

D.

Terraform binary

Question 72

A Terraform output that sets the "sensitive" argument to true will not store that value in the state file.

Options:

A.

True

B.

False

Question 73

What is the provider for this resource?

as

Options:

A.

Vpc

B.

Test

C.

Main

D.

aws

Question 74

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.

Question 75

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

Question 76

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

Question 77

When should you run terraform init?

Options:

A.

Every time you run terraform apply

B.

Before you start coding a new Terraform project

C.

After you run terraform plan for the time in a new terraform project and before you run terraform apply

D.

After you start coding a new terraform project and before you run terraform plan for the first time.

Page: 1 / 26
Total 256 questions