🔍

TA-004 — all questions

26 practice questions with answers and explanations.

Topic 1 · Question 1

What is an advantage of immutable infrastructure?

  • AAutomatic infrastructure upgrades
  • BIn-place infrastructure upgrades
  • CQuicker infrastructure upgrades (correct answer)
  • DLess complex infrastructure upgrades
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Quicker infrastructure upgrades

Topic 1 · Question 2

Your team adopts an AWS CloudFormation as the standardized method for provisioning public cloud resources. Which scenario presents a challenge for your team?

  • ADeploying new infrastructure into Microsoft Azure. (correct answer)
  • BAutomating a manual, web console-based provisioning process.
  • CBuilding a reusable code base that can deploy resources into any AWS region.
  • DManaging a new application stack built on AWS-native services.
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Deploying new infrastructure into Microsoft Azure.

Topic 2 · Question 3

Which command lets you experiment with Terraform expressions?

  • Aterraform console (correct answer)
  • Bterraform env
  • Cterraform validate
  • Dterraform test
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: terraform console

Explanation

terraform console evaluates Terraform expressions interactively using the current configuration and state.

Topic 2 · Question 4

You can install Community/Partner plugins using terraform init.

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

The correct answer is A. Option A: True

Topic 2 · Question 5 · Select all that apply

What functionality do providers offer in Terraform? (Choose three.)

  • AGroup a collection of Terraform configuration files that map to a single state file.
  • BProvision resources for public cloud infrastructure services. (correct answer)
  • CInteract with cloud provider APIs. (correct answer)
  • DEnforce security and compliance policies.
  • EProvision resources for on-premises infrastructure services. (correct answer)
Reveal answer & explanation
Correct answer: B, C, E

The correct answer is B, C, E. Option B: Provision resources for public cloud infrastructure services. Option C: Interact with cloud provider APIs. Option E: Provision resources for on-premises infrastructure services.

Explanation

A provider plugin implements resource types and data sources that communicate with an external API.

Topic 2 · Question 6

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

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

The correct answer is B. Option B: False

Topic 2 · Question 7

A resource block is shown in the Exhibit space of this page. resource “aws_vpc” “main” { name = “test” } What is the provider for this resource?

  • Amain
  • Bvpc
  • Caws (correct answer)
  • Dtest
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: aws

Topic 2 · Question 8

Terraform providers are always installed from the internet.

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

The correct answer is B. Option B: False

Topic 2 · Question 9

You need to determine from which paths Terraform is loading the providers referenced in your *.tf files. How can you enable additional logging to see this information?

  • ASet the environment variable TF_VAR_log=TRACE.
  • BSet the environment variable TF_LOG=TRACE. (correct answer)
  • CSet the environment variable TF_LOG=PATH.
  • DSet verbose logging for each provider in your Terraform configuration.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Set the environment variable TF_LOG=TRACE.

Topic 2 · Question 10

Which of these is stored in the .terraform directory?

  • AProviders and modules (correct answer)
  • BLock file
  • CState file
  • DConfiguration files
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Providers and modules

Explanation

A provider plugin implements resource types and data sources that communicate with an external API. A Terraform module packages related resources into a reusable configuration with defined inputs and outputs.

Topic 2 · Question 11

Where can Terraform not load a provider from?

  • AProvider plugin cache
  • BSource code (correct answer)
  • COfficial HashiCorp distribution on releases.hashicorp.com
  • DPlugins directory
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Source code

Topic 3 · Question 12

Which command must you run before you run a plan or apply for the first time?

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

The correct answer is D. Option D: terraform init

Explanation

terraform init initializes a working directory, installs required providers and modules, and configures the backend.

Topic 3 · Question 13

You modified your local Terraform configuration and ran 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.

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

The correct answer is B. Option B: False

Topic 3 · Question 14

Which syntax check returns an error when you run terraform validate?

  • ANone of these will return an error.
  • BThere is a missing variable block. (correct answer)
  • CThe state file does not match the current infrastructure.
  • DThe code contains tabs for indentation instead of spaces.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: There is a missing variable block.

Topic 4 · Question 15

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

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

The correct answer is A. Option A: True

Topic 4 · Question 16

You want to define multiple data disks as nested blocks inside the resource block for a virtual machine. What Terraform feature would help you define the blocks using the values in a variable?

  • ACount arguments
  • BCollection functions
  • CLocal values
  • DDynamic blocks (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Dynamic blocks

Explanation

A dynamic block programmatically generates repeatable nested blocks from a collection.

Topic 4 · Question 17

You are creating a reusable Terraform configuration and want to include an optional billing_dept tag so your Finance team can track team-specific spending on resources. Which of the following billing_dept variable declarations will achieve this?

  • Avariable “billing_dept” {default = “”} (correct answer)
  • Bvariable “billing_dept” {type = optional(string)}
  • Cvariable “billing_dept” {optional = true}
  • Dvariable “billing_dept” {type = default}
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: variable “billing_dept” {default = “”}

Topic 5 · Question 18

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

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

The correct answer is B. Option B: False

Topic 5 · Question 19

Your team is using a version 3.1.4 of a module from the public Terraform Registry, and they’re worried about possible breaking changes in future versions of the module. Which version argument should you add to the module block to prevent newer versions from being used?

  • Aversion = “3.1.4” (correct answer)
  • Bversion = “< 3.2”
  • Cversion = “!=3.1.5”
  • Dversion = “~>3.1.4”
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: version = “3.1.4”

Topic 6 · Question 20

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

  • Aterraform plan -refresh-only
  • Bterraform show -json
  • Cterraform apply =lock=false (correct answer)
  • Dterraform plan -target=state
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: terraform apply =lock=false

Explanation

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

Showing questions 120 of 26 · Page 1 of 2