Black Friday Special Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

Home > HashiCorp > Terraform Associate > Terraform-Associate-003

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

Question # 4

You modified your Terraform configuration and run Terraform plan to review the changes. Simultaneously, your teammate manually modified the infrastructure component you are working on. Since you already ran terraform plan locally, the execution plan for terraform apply will be the same.

A.

True

B.

False

Full Access
Question # 5

Which Terraform collection type should you use to store key/value pairs?

A.

Set

B.

Map

C.

Tuple

D.

list

Full Access
Question # 6

The_________determines how Terraform creates, updates, or delete resources.

A.

Terraform configuration

B.

Terraform provisioner

C.

Terraform provider

D.

Terraform core

Full Access
Question # 7

What is the workflow for deploying new infrastructure with Terraform?

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

Full Access
Question # 8

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

A.

True

B.

False

Full Access
Question # 9

Variables declared within a module are accessible outside of the module.

A.

True

B.

False

Full Access
Question # 10

Changing the Terraform backend from the default "local" backend to a different one after performing your first terrafom apply is:

A.

Optional

B.

Impossible

C.

Mandatory

D.

Discouraged

Full Access
Question # 11

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?

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

Full Access
Question # 12

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.

A.

True

B.

False

Full Access
Question # 13

Only the user that generated a plan may apply it.

A.

True

B.

False

Full Access
Question # 14

What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?

A.

Terraform plan –refresh-only

B.

Terraform show –json

C.

Terraform apply –lock-false

D.

Terraform plan target-state

Full Access
Question # 15

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

A.

Automatic backups of configuration and state.

B.

Remote state storage.

C.

Automated infrastructure deployment visualization.

D.

A web-based user interface (UI).

Full Access
Question # 16

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

A.

True

B.

False

Full Access
Question # 17

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?

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

Full Access
Question # 18

A provider configuration block is required in every Terraform configuration.

Example:

A.

True

B.

False

Full Access
Question # 19

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

A.

True

B.

False

Full Access
Question # 20

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

A.

The resource block

B.

The data source block

C.

The terraform block

D.

The provider block

Full Access
Question # 21

When you use a remote backend that needs authentication, HashiCorp recommends that you:

A.

Write the authentication credentials in the Terraform configuration files

B.

Keep the Terraform configuration files in a secret store

C.

Push your Terraform configuration to an encrypted git repository

D.

Use partial configuration to load the authentication credentials outside of the Terraform code

Full Access
Question # 22

How is terraform import run?

A.

As a part of terraform init

B.

As a part of terraform plan

C.

As a part of terraform refresh

D.

By an explicit call

E.

All of the above

Full Access
Question # 23

terraform validate reports syntax check errors for which of the following?

A.

Code contains tabs for indentation instead of spaces

B.

There is a missing value for a variable

C.

The state file does not match the current infrastructure

D.

None of the above

Full Access
Question # 24

You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (* files). You need to enable additional logging messages to find this out. Which of the following would achieve this?

A.

Set verbose for each provider in your Terraform configuration

B.

Set the environment variable TF_LOG_TRACE

C.

Set the environment variable TF_LOG_PATH

D.

Set the environment variable TF_log_TRACE

Full Access
Question # 25

Which two steps are required to provision new infrastructure in the Terraform workflow? Choose two correct answers.

A.

Plan

B.

Import

C.

Alidate

D.

Init

E.

apply

Full Access
Question # 26

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

A.

True

B.

False

Full Access
Question # 27

Which command add existing resources into Terraform state?

A.

Terraform init

B.

Terraform plan

C.

Terraform refresh

D.

Terraform import

E.

All of these

Full Access
Question # 28

When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)

A.

When you change a Terraform-managed resource via the Azure Cloud Console, Terraform updates the state file to reflect the change during the next plan or apply

B.

Changing resources via the Azure Cloud Console records the change in the current state file

C.

When you change a resource via the Azure Cloud Console, Terraform records the changes in a new state file

D.

Changing resources via the Azure Cloud Console does not update current state file

Full Access
Question # 29

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?

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

Full Access
Question # 30

When should you run terraform init?

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.

Full Access
Question # 31

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

A.

True

B.

False

Full Access
Question # 32

Which task does terraform init not perform?

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

Full Access
Question # 33

Which command lets you experiment with terraform expressions?

A.

Terraform console

B.

Terraform validate

C.

Terraform env

D.

Terraform test

Full Access
Question # 34

What does the default "local" Terraform backend store?

A.

tfplan files

B.

State file

C.

Provider plugins

D.

Terraform binary

Full Access
Question # 35

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

A.

True

B.

False

Full Access
Question # 36

Which of these ate features of Terraform Cloud? Choose two correct answers.

A.

Automated infrastructure deployment visualization

B.

Automatic backups

C.

A web-based user interface (Ul)

D.

Remote state storage

Full Access
Question # 37

Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state files. How can you protect that data?

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

Full Access
Question # 38

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

A.

True

B.

False

Full Access
Question # 39

What is a key benefit of the Terraform state file?

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

Full Access
Question # 40

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

A.

True

B.

False

Full Access
Question # 41

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

A.

True

B.

False

Full Access
Question # 42

How does Terraform manage most dependencies between resources?

A.

Terraform will automatically manage most resource dependencies

B.

Using the depends_on parameter

C.

By defining dependencies as modules and including them in a particular order

D.

The order that resources appear in Terraform configuration indicates dependencies

Full Access
Question # 43

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

A.

True

B.

False

Full Access
Question # 44

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

A.

True

B.

False

Full Access
Question # 45

In a Terraform Cloud workpace linked to a version control repository speculative plan rum start automatically commit changes to version control.

A.

True

B.

False

Full Access
Question # 46

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

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

Full Access
Question # 47

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

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

Full Access
Question # 48

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

A.

True

B.

False

Full Access
Question # 49

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

A.

True

B.

False

Full Access
Question # 50

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.

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 }

Full Access
Question # 51

Terraform configuration can only call modules from the public registry.

A.

True

B.

False

Full Access
Question # 52

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

A.

True

B.

False

Full Access
Question # 53

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

A.

True

B.

False

Full Access
Question # 54

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

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.

Full Access
Question # 55

How does Terraform determine dependencies between resources?

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

Full Access
Question # 56

Which backend does the Terraform CU use by default?

A.

Depends on the cloud provider configured

B.

HTTP

C.

Remote

D.

Terraform Cloud

E.

Local

Full Access
Question # 57

If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?

A.

Run terraform refresh

B.

It will happen automatically

C.

Manually update the state fire

D.

Run terraform import

Full Access
Question # 58

terraform plan updates your state file.

A.

True

B.

False

Full Access