Spring Sale Limited Time Flat 70% Discount offer - Ends in 0d 00h 00m 00s - Coupon code: 70spcl

HashiCorp Terraform-Associate-004 HashiCorp Certified: Terraform Associate (004) (HCTA0-004) Exam Practice Test

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

Question 1

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

Question 2

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 3

What is a key benefit of the Terraform state file?

Options:

A.

A state file can schedule recurring infrastructure tasks

B.

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

C.

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

D.

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

Question 4

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 5

Terraform configuration can only call modules from the public registry.

Options:

A.

True

B.

False

Question 6

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.

Question 7

You add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The existing and new resources use the same provider. The working contains a .terraform.lock, hc1 file.

How will Terraform choose which version of the provider to use?

Options:

A.

Terraform will use the version recorded in your lock file

B.

Terraform will use the latest version of the provider for the new resource and the version recorded in the lock file to manage existing resources

C.

Terraform will check your state file to determine the provider version to use

D.

Terraform will use the latest version of the provider available at the time you provision your new resource

Question 8

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 9

Terraform providers are always installed from the Internet.

Options:

A.

True

B.

False

Question 10

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

Options:

A.

True

B.

False

Question 11

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

Question 12

Exhibit:

module " network " {

source = " terraform-google-modules/network/google "

version = " ~ > 11.0 "

}

What version of the source module does Terraform allow with the module block shown in the exhibit?

Options:

A.

Any version of the module > 11.0.

B.

Any version of the module > = 11.0.

C.

Any version of the module > = 11.0 and < 12.0.

D.

Any version of the module > = 11.0.0 and < 11.1.0.

Question 13

A Terraform local value can reference other Terraform local values.

Options:

A.

True

B.

False

Question 14

You can develop a custom provider to manage its resources using Terraform.

Options:

A.

True

B.

False

Question 15

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.

Question 16

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

Question 17

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.

Question 18

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.

Question 19

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.

Question 20

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.

Question 21

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.

Question 22

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

Options:

A.

The resource block

B.

The data source block

C.

The terraform block

D.

The provider block

Question 23

What is the purpose of the .terraform directory in a Terraform workspace?

Options:

A.

The directory is where Terraform creates and maintains the state file to track the underlying resources it creates and manages.

B.

The directory is used to convert and store Terraform configuration files into API calls to communicate with the targeted platform.

C.

The directory contains the provider credentials and the .tfvars files to prevent them from being committed to version control by accident.

D.

The directory contains plugins and modules that Terraform downloads during initialization, along with other important information.

Question 24

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 25

terraform plan updates your state file.

Options:

A.

True

B.

False

Question 26

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 27

Terraform variables and outputs that set the description argument will store that description in the state file.

Options:

A.

True

B.

False

Question 28

How would you reference the volume IDs associated with the ebs_block_device blocks in this configuration?

Question # 28

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

Question 29

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.

Question 30

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

Question 31

Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?

Options:

A.

They can securely store cloud credentials.

B.

They have role-based access controls.

C.

Plans and applies can be triggered via version control system integrations.

D.

You must use the CLI to switch between workspaces.

Question 32

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

Question 33

Which of the following should you put into the required_providers block?

Options:

A.

version > = 3.1

B.

version = “ > = 3.1”

C.

version ~ > 3.1

Question 34

What value does the Terraform Cloud private registry provide over the public Terraform Module Registry?

Options:

A.

The ability to share modules publicly with any user of Terraform

B.

The ability to restrict modules to members of Terraform Cloud or Enterprise organizations

C.

The ability to tag modules by version or release

D.

The ability to share modules with public Terraform users and members of Terraform Cloud Organizations

Question 35

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

Options:

A.

True

B.

False

Question 36

Which task does terraform init not perform?

Options:

A.

Discovers all providers used in the configuration and downloads them.

B.

Validates that values are set for all required input variables.

C.

Connects to the configured backend.

D.

Discovers any remote modules and downloads them.

Question 37

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.

Question 38

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.

Question 39

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

Options:

A.

Tree

B.

Map

C.

List

D.

set

Question 40

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 41

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 42

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.

Question 43

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

Question 44

A developer accidentally launched a VM (virtual machine) outside of the Terraform workflow and ended up with two servers with the same name. They don ' t know which VM Terraform manages but do have a list of all active VM IDs.

Which of the following methods could you use to discover which instance Terraform manages?

Options:

A.

Run terraform state list to find the names of all VMs, then run terraform state show for each of them to find which VM ID Terraform manages

B.

Update the code to include outputs for the ID of all VMs, then run terraform plan to view the outputs

C.

Run terraform taint/code on all the VMs to recreate them

D.

Use terraform refresh/code to find out which IDs are already part of state

Question 45

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.

Question 46

Exhibit:

provider " aws " { region = " us-east-1 " }

provider " aws " { region = " us-west-2 " }

You need to deploy resources into two different AWS regions in the same Terraform configuration using the provider blocks shown in the exhibit. What do you need to add to the provider configuration to deploy a resource to the us-west-2 AWS region?

Options:

A.

Add an alias to the us-west-2 provider (for example, alias = " west " ) and set provider = aws.west on resources that should use us-west-2.

B.

Rename the provider block to provider " aws " " west " { region = " us-west-2 " }.

C.

Create a new provider named provider " aws_west " { region = " us-west-2 " }.

D.

Nothing. Terraform will automatically decide which provider to use for each resource.

Question 47

What is a Terraform provider not responsible for?

Options:

A.

Provisioning infrastructure in multiple cloud providers.

B.

Managing actions to take based on resource differences.

C.

Managing resources and data sources based on an API.

D.

Understanding API interactions with a hosted service.

Question 48

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

Question 49

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

Pick the 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.

Question 50

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

Question 51

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.

Question 52

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 53

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

Options:

A.

True

B.

False

Question 54

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.

Question 55

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

Question 56

Exhibit:

resource " aws_instance " " example " {

ami = " ami-0a123456789abcdef "

instance_type = " t3.micro "

}

You are updating a child module with the resource block shown in the exhibit. The public_ip attribute of the resource needs to be accessible to the parent module. How do you meet this requirement?

Options:

A.

Create an output in the child module.

B.

Add a data source to the parent module.

C.

Add an import block to the parent module.

D.

Create a local value in the child module.

Question 57

When you run terraform apply, the Terraform CLI will print output values from both the root module and any child modules.

Options:

A.

True

B.

False

Question 58

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

Question 59

How can a ticket-based system slow down infrastructure provisioning and limit the ability to scale? Choose two correct answers.

Options:

A.

End-users have to request infrastructure changes

B.

Ticket based systems generate a full audit trail of the request and fulfillment process

C.

Users can access catalog of approved resources from drop down list in a request form

D.

The more resources your organization needs, the more tickets your infrastructure team has to process

Question 60

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

Question 61

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 62

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

Options:

A.

True

B.

False

Question 63

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.

Question 64

Only the user that generated a plan may apply it.

Options:

A.

True

B.

False

Question 65

A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of that resource block?

Options:

A.

azurerm

B.

azurerm_resource_group

C.

ev

D.

test

Question 66

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

Options:

A.

Terraform plan rm:aws_instance.ubuntu[1]

B.

Terraform state rm:aws_instance.ubuntu[1]

C.

Terraform apply rm:aws_instance.ubuntu[1]

D.

Terraform destory rm:aws_instance.ubuntu[1]

Question 67

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 68

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 }

Question 69

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 70

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

}

Question 71

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 72

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

Options:

A.

True

B.

False

Question 73

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 74

Your risk management organization requires that new AWS S3 buckets must be private and encrypted at rest. How can Terraform Cloud automatically and proactively enforce this security control?

Options:

A.

Auditing cloud storage buckets with a vulnerability scanning tool

B.

By adding variables to each Terraform Cloud workspace to ensure these settings are always enabled

C.

With an S3 module with proper settings for buckets

D.

With a Sentinel policy, which runs before every apply

Question 75

When do you need to explicitly execute Terraform in refresh-only mode?

Options:

A.

Before every terraform plan.

B.

Before every terraform apply.

C.

Before every terraform import.

D.

None of the above.

Question 76

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 77

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

Question 78

Which of these are features of HCP Terraform/Terraform Cloud? Pick the 2 correct responses below.

Options:

A.

Automated infrastructure deployment visualization.

B.

A web-based user interface (UI).

C.

Automatic backups of configuration and state.

D.

Remote state storage.

Question 79

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.

Question 80

Why would you use the -replace flag for terraform apply?

Options:

A.

You want to force Terraform to destroy a resource on the next apply.

B.

You want Terraform to ignore a resource on the next apply.

C.

You want to force Terraform to destroy and recreate a resource on the next apply.

D.

You want Terraform to destroy all the infrastructure in your workspace.

Question 81

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

Options:

A.

resource.kubernetes_namespace.example.name

B.

kubernetes_namespace.example.name

C.

data.kubernetes.namespace.name

D.

kubernetes_namespace.test.name

Question 82

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 83

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 84

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

Question 85

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 86

Terraform encrypts sensitive values stored in your state file.

Options:

A.

True

B.

False

Question 87

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

Options:

A.

True

B.

False

Question 88

What is the purpose of state locking in a remote backend?

Options:

A.

Encrypts the state in the remote backend.

B.

Requires every instance of Terraform to use the same provider version.

C.

Creates a backup of the state file in a secure location.

D.

Ensures only one instance of Terraform can modify the state at a time.

Question 89

It is best practice to store secret data in the same version control repository as your Terraform configuration.

Options:

A.

True

B.

False

Question 90

If a module declares a variable with a default, that variable must also be defined within the module.

Options:

A.

True

B.

False

Question 91

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

Options:

A.

True

B.

False

Question 92

What is the provider for this resource?

Options:

A.

Vpc

B.

Test

C.

Main

D.

aws

Question 93

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

Question 94

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.

Question 95

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