Summer Limited Time 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: wrap60

HashiCorp Terraform-Associate-003 Dumps

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

Question 1

You use a cloud provider account that is shared with other team members. You previously used Terraform to create a load balancer that listens on port 80. After application changes, you updated the Terraform code to change the port to 443.

You run terraform plan and see that the execution plan shows the port changing from 80 to 443 like you intended and step away to grab some coffee.

In the meantime, another team member manually changes the load balancer port to 443 through the cloud provider console before you get back to your desk.

What will happen when you run terraform apply upon returning to your desk?

Options:

A.

Terraform will recreate the load balancer.

B.

Terraform will fail with an error because the state file is no longer accurate.

C.

Terraform will change the load balancer port to 80, and then change it back to 443.

D.

Terraform will not make any changes to the load balancer and will update the state file to reflect the manual change.

Question 2

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 3

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 4

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 5

Which of these is true about Terraform's plugin-based architecture?

Options:

A.

Terraform can only source providers from the internet

B.

Every provider in a configuration has its own state file for its resources

C.

You can create a provider for your API if none exists

D.

All providers are part of the Terraform core binary

Question 6

What functionality do providers offer in Terraform?(Pick 3 correct responses)

Options:

A.

Interact with cloud provider APIs.

B.

Provision resources for on-premises infrastructure services.

C.

Group a collection of Terraform configuration files that map to a single state file.

D.

Provision resources for public cloud infrastructure services.

E.

Enforce security and compliance policies.

Question 7

All modules published on the official Terraform Module Registry have been verified by HasihCorp.

Options:

A.

True

B.

False

Question 8

Which of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.

Options:

A.

Lets you version, reuse, and share infrastructure configuration

B.

Provisions the same resources at a lower cost

C.

Secures your credentials

D.

Reduces risk of operator error

E.

Prevents manual modifications to your resources

Question 9

A module block is shown in the Exhibit space of this page. When you use a module block to reference a module from the Terraform Registry such as the one in the example, how do you specify version 1.0.0 of the module?

Options:

A.

Append ?ref=v1.0.0 argument to the source path.

B.

You cannot. Modules stored on the public Terraform Registry do not support versioning.

C.

Add a version = "1.0.0" attribute to the module block.

D.

Nothing. Modules stored on the public Terraform module Registry always default to version 1.0.0.

Question 10

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

Question 11

You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into a file called backend.tf.

as

Which command will migrate your current state file to the new S3 remote backend?

Options:

A.

terraform state

B.

terraform init

C.

terraform push

D.

terraform refresh

Question 12

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 13

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 14

Which command lets you experiment with terraform expressions?

Options:

A.

Terraform console

B.

Terraform validate

C.

Terraform env

D.

Terraform test

Question 15

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 16

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

Question 17

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

Options:

A.

A web-based user interface (Ul)

B.

Automated infrastructure deployment visualization

C.

Automatic backups

D.

Remote state storage

Question 18

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 19

A terraform apply can not _________ infrastructure.

Options:

A.

change

B.

destroy

C.

provision

D.

import

Question 20

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

Options:

A.

You want Terraform to ignore a resource on the next apply

B.

You want Terraform to destroy all the infrastructure in your workspace

C.

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

D.

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

Question 21

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 22

A Terraform backend determines how Terraform loads state and stores updates when you execute which command?

Options:

A.

apply

B.

destroy

C.

Both of these are correct.

D.

Neither of these are correct.

Question 23

You have just developed a new Terraform configuration for two virtual machines with a cloud provider. You would like to create the infrastructure for the first time.

Which Terraform command should you runfirst?

Options:

A.

terraform apply

B.

terraform init

C.

terraform plan

D.

terraform show

Question 24

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 25

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 26

Which backend does the Terraform CU use by default?

Options:

A.

Depends on the cloud provider configured

B.

HTTP

C.

Remote

D.

Terraform Cloud

E.

Local

Question 27

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?

Options:

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

Question 28

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

Options:

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.

Question 29

Which command(s) adds existing resources in a public cloud into Terraform state?

Options:

A.

terraform init

B.

terraform plan

C.

terraform refresh

D.

terraform import

E.

All of these

Question 30

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

Options:

A.

Set

B.

Map

C.

Tuple

D.

list

Question 31

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 32

What does terraform import do?

Options:

A.

Imports existing resources into the state file

B.

Imports all infrastructure from a given cloud provider

C.

Imports a new Terraform module

D.

Imports clean copies of tainted resources

E.

None of the above

Question 33

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

Options:

A.

True

B.

False

Question 34

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

Question 35

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

Options:

A.

True

B.

False

Question 36

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

Question 37

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

Options:

A.

version

B.

version = "3.1"

C.

version: 3.1

D.

version - 3.1

Question 38

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

Options:

A.

True

B.

False

Question 39

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

Options:

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

Question 40

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

Question 41

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 42

You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?

Options:

A.

Run terraform refresh.

B.

Run terraform init -upgrade.

C.

Run terraform apply -upgrade.

D.

Upgrade your version of Terraform.

Question 43

terraform plan updates your state file.

Options:

A.

True

B.

False

Question 44

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.

Options:

A.

True

B.

False

Question 45

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 46

A developer on your team is going lo 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 47

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

Options:

A.

test

B.

google

C.

compute_instance

D.

main

Question 48

Your root module contains a variable namednum_servers. Which is the correct way to pass its value to a child module with an input namedservers?

Options:

A.

servers = num_servers

B.

servers = var(num_servers)

C.

servers = var.num_servers

D.

servers = ${var.num_servers}

Question 49

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

to = 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 ID.

Question 50

Which of these commands makes your code more human readable?

Options:

A.

Terraform validate

B.

Terraform output

C.

Terraform show

D.

Terraform file

Question 51

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

Options:

A.

list

B.

array

C.

nap

D.

string

Question 52

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 53

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

Options:

A.

Automated infrastructure deployment visualization

B.

Automatic backups

C.

A web-based user interface (Ul)

D.

Remote state storage

Question 54

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 55

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 56

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 57

Which is the best way to specify a tag of v1.0.0 when referencing a module stored in Git (for example.

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 58

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 59

terraform apply is failing with the following error. What next step should you take to determine the root cause of the problem?

Error:

yaml

CopyEdit

Error loading state: AccessDenied: Access Denied

status code: 403, request id: 288766CE5CCA24A0, host id: web.example.com

Options:

A.

Run terraform login to reauthenticate with the provider.

B.

Set TF_LOG=DEBUG.

C.

Review /var/log/terraform.log for error messages.

D.

Review syslog for Terraform error messages.

Question 60

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

Question 61

When should you use the force-unlock command?

Options:

A.

You have a high priority change

B.

Automatic unlocking failed

C.

apply failed due to a state lock

D.

You see a status message that you cannot acquire the lock

Question 62

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 63

Terraform providers are part of the Terraform core binary.

Options:

A.

True

B.

False

Question 64

Which command doesnotcause Terraform to refresh its state?

Options:

A.

terraform state list

B.

terraform plan

C.

terraform apply

D.

terraform destroy

Question 65

terraform validate confirms thesyntaxof Terraform files.

Options:

A.

True

B.

False

Question 66

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 67

Terraform configuration can only call modules from the public registry.

Options:

A.

True

B.

False

Question 68

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 69

You much initialize your working directory before running terraform validate.

Options:

A.

True

B.

False

Question 70

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 71

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

Options:

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

Page: 1 / 25
Total 248 questions