Weekend Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: suredis

HashiCorp Terraform-Associate-003 HashiCorp Certified: Terraform Associate (003) Exam Practice Test

HashiCorp Certified: Terraform Associate (003) Questions and Answers

Testing Engine

  • Product Type: Testing Engine
$42  $119.99

PDF Study Guide

  • Product Type: PDF Study Guide
$36.75  $104.99
Question 1

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] theywould 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 2

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 3

What type of block is used to construct a collection of nested configuration blocks?

Options:

A.

Dynamic

B.

For_each

C.

Nesting

D.

repeated.

Question 4

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

Options:

A.

True

B.

False

Question 5

Terraform configuration can only import modules from the public registry.

Options:

A.

True

B.

False

Question 6

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 7

Which command lets you experiment with terraform expressions?

Options:

A.

Terraform console

B.

Terraform validate

C.

Terraform env

D.

Terraform test

Question 8

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 9

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 10

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

Options:

A.

True

B.

False

Question 11

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

Options:

A.

True

B.

False

Question 12

Infrastructure as Code (laC) can be stored in a version control system along with application code.

Options:

A.

True

B.

False

Question 13

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 14

What is the workflow for deploying new infrastructure with Terraform?

Options:

A.

Write Terraform configuration, run terraform init to initialize the working directory or

workspace, 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 15

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 16

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

Options:

A.

True

B.

False

Question 17

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

Question 18

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

Question 19

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

Question 20

What does the default "local" Terraform backend store?

Options:

A.

tfplan files

B.

State file

C.

Provider plugins

D.

Terraform binary

Question 21

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.

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 22

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 23

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

Options:

A.

True

B.

False

Question 24

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 25

When using a remote backend or terraform Cloud integration, where does Terraform save resource sate?

Options:

A.

In an environment variable

B.

On the disk

C.

In the remote backend or Terraform Cloud

D.

In memory

Question 26

You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with Terraform and want to manage these VMs using Terraform instead. What are the two things you must do to achieve this? Choose two correct answers.

Options:

A.

Run the terraform Import-gcp command

B.

Write Terraform configuration for the existing VMs

C.

Use the terraform import command for the existing VMs

D.

Provision new VMs using Terraform with the same VM names

Question 27

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

Options:

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

Question 28

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

Question 29

Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?

Options:

A.

Terraform state show ‘ provider_type_name

B.

Terraform state list

C.

Terraform get provider_type_name

D.

Terraform state list provider_type_name

Question 30

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 31

If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform Init.

Options:

A.

True

B.

False

Question 32

Only the user that generated a plan may apply it.

Options:

A.

True

B.

False

Question 33

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 34

You ate making changes to existing Terraform code to add some new infrastructure. When is the best time to run terraform validate?

Options:

A.

After you run terraform apply so you can validate your infrastructure

B.

Before you run terraform apply so you can validate your provider credentials

C.

Before you run terraform plan so you can validate your code syntax

D.

After you run terraform plan so you can validate that your state file is consistent with your infrastructure

Question 35

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 36

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

Question 37

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?

A)

B)

C)

D)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 38

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 39

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)

B)

C)

D)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Question 40

A provider configuration block is required in every Terraform configuration.

Example:

Options:

A.

True

B.

False

Question 41

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 42

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

Options:

A.

True

B.

False

Question 43

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 44

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 45

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 46

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 47

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

Options:

A.

True

B.

False

Question 48

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

Options:

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