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

Terraform-Associate-003 Questions and Answers

Question # 6

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

A.

version

B.

version = "3.1"

C.

version: 3.1

D.

version - 3.1

Full Access
Question # 7

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

A.

True

B.

False

Full Access
Question # 8

Terraform providers are part of the Terraform core binary.

A.

True

B.

False

Full Access
Question # 9

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

A.

Terraform state show ‘ provider_type_name

B.

Terraform state list

C.

Terraform get provider_type_name

D.

Terraform state list provider_type_name

Full Access
Question # 10

Define the purpose of state in Terraform.

A.

State maps real world resources to your configuration and keeps track of metadata

B.

State lets you enforce resource configurations that relate to compliance policies

C.

State stores variables and lets you quickly reuse existing code

D.

State codifies the dependencies of related resources

Full Access
Question # 11

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

A.

True

B.

False

Full Access
Question # 12

Which are forbidden actions when the terraform state file is locked? Choose three correct answers.

A.

Terraform state list

B.

Terraform destroy

C.

Terraform validate

D.

Terraform validate

E.

Terraform for

F.

Terraform apply

Full Access
Question # 13

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

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.

Full Access
Question # 14

What feature stops multiple users from operating on the Terraform state at the same time?

A.

State locking

B.

Version control

C.

Provider constraints

D.

Remote backends

Full Access
Question # 15

Which of the following is not a key principle of infrastructure as code?

A.

Self-describing infrastructure

B.

Idempotence

C.

Versioned infrastructure

D.

Golden images

Full Access
Question # 16

When does Sentinel enforce policy logic during a Terraform Cloud run?

A.

Before the plan phase

B.

During the plan phase

C.

Before the apply phase

D.

After the apply phase

Full Access
Question # 17

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

A.

True

B.

False

Full Access
Question # 18

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

A.

apply

B.

destroy

C.

Both of these are correct.

D.

Neither of these are correct.

Full Access
Question # 19

Only the user that generated a plan may apply it.

A.

True

B.

False

Full Access
Question # 20

By default, if you do not define a backend for your configuration, where does Terraform store information about the resources that it manages?

A.

A subdirectory of your home directory named .terraform.d

B.

A file in your configuration's directory named terraform.tfstate

C.

A file in your configuration's directory named .terraform.lock.hcl

D.

A subdirectory of your configuration named .terraform

Full Access
Question # 21

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?

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.

Full Access
Question # 22

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

A.

True

B.

False

Full Access
Question # 23

Which of these are benefits of using Sentinel with HCP Terraform/Terraform Cloud? (Pick the 3 correct responses)

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.

Full Access
Question # 24

What is the Terraform style convention for indenting a nesting level compared to the one above it?

A.

With a tab

B.

With two spaces

C.

With four spaces

D.

With three spaces

Full Access
Question # 25

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)

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

Full Access
Question # 26

Which of the following is not a benefit of adopting infrastructure as code?

A.

Versioning

B.

A Graphical User Interface

C.

Reusability of code

D.

Automation

Full Access
Question # 27

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 # 28

When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?

A.

You can import infrastructure without corresponding Terraform code

B.

Terraform will generate the corresponding configuration files for you

C.

Before you run terraform Import

D.

After you run terraform import

Full Access
Question # 29

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

A.

True

B.

False

Full Access
Question # 30

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 # 31

terraform apply will fail if you have not run terraform plan first to update the plan output.

A.

True

B.

False

Full Access
Question # 32

You cannot install third party plugins using terraform init.

A.

True

B.

False

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

You much initialize your working directory before running terraform validate.

A.

True

B.

False

Full Access
Question # 35

When you initialize Terraform, where does it cache modules from the public Terraform Registry?

A.

In the /tmp directory.

B.

In the .terraform sub-directory.

C.

In memory.

D.

They are not cached.

Full Access
Question # 36

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

A.

True

B.

False

Full Access
Question # 37

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

A.

True

B.

False

Full Access
Question # 38

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

A.

True

B.

False

Full Access
Question # 39

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

A.

terraform state list ‘provider_type.name’

B.

terraform state show ‘provider_type.name’

C.

terraform get ‘provider_type.name’

D.

terraform state list

Full Access
Question # 40

All standard backend types support state locking, and remote operations like plan, apply, and destroy.

A.

True

B.

False

Full Access
Question # 41

Which method for sharing Terraform configurations fulfills the following criteria:

1. Keeps the configurations confidential within your organization

2. Support Terraform’s semantic version constrains

3. Provides a browsable directory

A.

Subfolder within a workspace

B.

Generic git repository

C.

Terraform Cloud private registry

D.

Public Terraform module registry

Full Access
Question # 42

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

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.

Full Access
Question # 43

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

A.

A web-based user interface (Ul)

B.

Automated infrastructure deployment visualization

C.

Automatic backups

D.

Remote state storage

Full Access
Question # 44

Which command doesnotcause Terraform to refresh its state?

A.

terraform state list

B.

terraform plan

C.

terraform apply

D.

terraform destroy

Full Access
Question # 45

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

A.

True

B.

False

Full Access
Question # 46

When does Terraform create the .terraform.lock.hc1 file?

A.

After your first terraform plan

B.

After your first terraform apply

C.

After your first terraform init

D.

When you enable state locking

Full Access
Question # 47

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 # 48

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

A.

True

B.

False

Full Access
Question # 49

Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.

A.

True

B.

False

Full Access
Question # 50

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

A.

True

B.

False

Full Access
Question # 51

The_________determines how Terraform creates, updates, or delete resources.

A.

Terraform configuration

B.

Terraform provisioner

C.

Terraform provider

D.

Terraform core

Full Access
Question # 52

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 # 53

Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?

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

Full Access
Question # 54

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

A.

True

B.

False

Full Access
Question # 55

Which of the following is availableonlyinHCP Terraform workspacesandnot in Terraform CLI?

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.

Full Access
Question # 56

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 # 57

Which of these actions will prevent two Terraform runs from changing the same state file at the same time?

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

Full Access
Question # 58

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

A.

Required input variables.

B.

Outputs.

C.

Optional input variables and default values.

D.

All of the above.

Full Access
Question # 59

Terraform configuration can only call modules from the public registry.

A.

True

B.

False

Full Access
Question # 60

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

A.

data

B.

local

C.

resource

D.

provider

Full Access
Question # 61

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?

A.

Artifactory

B.

Amazon S3

C.

Terraform Cloud

D.

Git

Full Access
Question # 62

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?

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

Full Access
Question # 63

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

A.

True

B.

False

Full Access
Question # 64

Which of these statements about Terraform Cloud workspaces is false?

A.

They have role-based access controls

B.

You must use the CLI to switch between workspaces

C.

Plans and applies can be triggered via version control system integrations

D.

They can securely store cloud credentials

Full Access
Question # 65

terraform validate uses provider APIs to verify your infrastructure settings.

A.

True

B.

False

Full Access
Question # 66

terraform init retrieves and caches the configuration for all remote modules.

A.

True

B.

False

Full Access
Question # 67

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

A.

True

B.

False

Full Access
Question # 68

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 # 69

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 # 70

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

A.

True

B.

False

Full Access
Question # 71

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