🔍

TA-003 — questions

Page 14 of 19 · 368 total questions.

Topic 1 · Question 268

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

  • ATrue
  • BFalse (correct answer)
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: False

Topic 1 · Question 269

You must initialize your working directory before running terraform validate.

  • ATrue (correct answer)
  • BFalse
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: True

Topic 1 · Question 270

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

  • AManually update the state fire
  • BRemove the resource definition from your file and run terraform apply -refresh-only (correct answer)
  • CRun terraform import
  • DIt will happen automatically
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Remove the resource definition from your file and run terraform apply -refresh-only

Explanation

terraform apply executes the dependency-aware changes required to make infrastructure match the configuration.

Topic 1 · Question 271

You created infrastructure outside of the Terraform workflow that you now want to manage using Terraform. Which command brings the infrastructure into Terraform state?

  • Aterraform init
  • Bterraform get
  • Cterraform refresh
  • Dterraform import (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: terraform import

Explanation

terraform import associates an existing remote object with a resource address in Terraform state.

Topic 1 · Question 272

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

  • AWhen 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
  • BChanging resources via the Azure Cloud Console records the change in the current state file
  • CWhen you change a resource via the Azure Cloud Console, Terraform records the changes in a new state file
  • DChanging resources via the Azure Cloud Console does not update current state file (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Changing resources via the Azure Cloud Console does not update current state file

Explanation

Terraform state maps resource addresses to remote objects and stores metadata needed to calculate changes efficiently.

Topic 1 · Question 273

Which statement describes a goal of infrastructure as code?

  • AA pipeline process to test and deliver software
  • BDefining a vendor-agnostic API
  • CWrite once, run anywhere
  • DThe programmatic configuration of resources (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: The programmatic configuration of resources

Topic 1 · Question 274

terraform validate confirms the syntax of Terraform files.

  • ATrue (correct answer)
  • BFalse
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: True

Topic 1 · Question 275

Which command adds existing resources into Terraform state?

  • Aterraform init
  • Bterraform plan
  • Cterraform refresh
  • Dterraform import (correct answer)
  • EAll of these
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: terraform import

Explanation

terraform import associates an existing remote object with a resource address in Terraform state.

Topic 1 · Question 276

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

  • ATrue
  • BFalse (correct answer)
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: False

Topic 1 · Question 277

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

  • Aterraform state list ‘provider_type.name’
  • Bterraform state show ‘provider_type.name’ (correct answer)
  • Cterraform get ‘provider_type.name’
  • Dterraform state list
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: terraform state show ‘provider_type.name’

Explanation

terraform state subcommands inspect and safely modify resource bindings recorded in state. A provider plugin implements resource types and data sources that communicate with an external API.

Topic 1 · Question 278

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

  • ATrue
  • BFalse (correct answer)
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: False

Topic 1 · Question 279

A senior admin accidentally deleted some of your cloud instances. What does Terraform do when you run terraform apply?

  • ABuild a completely brand new set of infrastructure
  • BTear down the entire workspace infrastructure and rebuild it
  • CRebuild only the instances that were deleted (correct answer)
  • DStop and generate an error message about the missing instances
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Rebuild only the instances that were deleted

Topic 1 · Question 280

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

  • ATrue
  • BFalse (correct answer)
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: False

Topic 1 · Question 281

Which argument helps prevent unexpected updates when calling Terraform Registry modules?

  • Acount
  • Bsource
  • Cversion (correct answer)
  • Dlifecycle
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: version

Topic 1 · Question 282

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

  • ATrue
  • BFalse (correct answer)
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: False

Topic 1 · Question 283

How would you output returned values from a child module in the Terraform CLI output?

  • ADeclare the output in the root configuration
  • BDeclare the output in the child module
  • CDeclare the output in both the root and child module (correct answer)
  • DNone of the above
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Declare the output in both the root and child module

Explanation

A Terraform module packages related resources into a reusable configuration with defined inputs and outputs. A child module is called by another module to reuse and encapsulate infrastructure configuration.

Topic 1 · Question 284

What is the Terraform resource name of the following resource block?

Exhibit 1 for question 284
  • Aazurerm_resource_group
  • Bazurerm
  • Ctest
  • Ddev (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: dev

Topic 1 · Question 285

When do you need to explicitly execute terraform refresh-only?

  • ABefore every terraform plan
  • BBefore every terraform apply
  • CBefore every terraform import
  • DNone of the above (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: None of the above

Topic 1 · Question 286

How is the Terraform cloud integration differ from other state backends such as S3, Consul, etc.?

  • AIt can execute Terraform runs on dedicated infrastructure in Terraform Cloud (correct answer)
  • BIt doesn't show the output of a terraform apply locally
  • CIt is only available to paying customers
  • DAll of the above
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: It can execute Terraform runs on dedicated infrastructure in Terraform Cloud

Explanation

Terraform Cloud, now HCP Terraform, provides managed remote runs, state, collaboration, policy, and governance.

Topic 1 · Question 287 · Select all that apply

Which of the following are advantages of using infrastructure as code (IaC) instead of provisioning with a graphical user interface (GUI)? (Choose two.)

  • ASecures your credentials
  • BLets your version, reuse, and share infrastructure configuration (correct answer)
  • CProvisions the same resources at a lower cost
  • DReduces risk of operator error (correct answer)
  • EPrevents manual modifications to your resources
Reveal answer & explanation
Correct answer: B, D

The correct answer is B, D. Option B: Lets your version, reuse, and share infrastructure configuration Option D: Reduces risk of operator error

Showing questions 261280 of 368 · Page 14 of 19