TA-004 Sample Questions & Answers
Resource and data blocks, cross-resource references, and variables take the biggest share, built on why IaC matters, installing and versioning providers, the write-plan-apply workflow, sourcing modules, local versus remote state, and HCP Terraform collaboration.
Launch the full TA-004 simulator →Showing 6 of 12 free samples.
- Question 1Intermediate
Infrastructure as Code (IaC) with Terraform · Explain how Terraform manages multi-cloud, hybrid cloud, and service-agnostic workflows
A platform team manages a complex application stack using IaC. To ensure high availability, they want to deploy the application across multiple distinct cloud providers (e.g., AWS and Azure) using a single Terraform configuration. Which statement accurately describes the feasibility and approach for this requirement?
Show answer & explanation
Correct answer: C
Terraform supports multi-cloud orchestration within a single configuration by simply defining multiple
providerblocks (e.g., one forawsand one forazurerm). Resources are then associated with the respective providers. - Question 2Beginner
Terraform Fundamentals · Install and version Terraform providers
You have added a new provider to your existing
versions.tffile. When you attempt to runterraform plan, you receive an error stating the provider is missing. What is the immediate next step you must take to resolve this?Show answer & explanation
Correct answer: A
Whenever a new provider is added or a version constraint is changed,
terraform initmust be run to download the plugin binary to the.terraformdirectory and update the.terraform.lock.hclfile. - Question 3Intermediate
Terraform Fundamentals · Install and version Terraform providers
A team needs to ensure that the exact same version of a Terraform provider is used by every developer and the CI/CD pipeline to prevent "works on my machine" issues. Which file is primarily responsible for enforcing these specific checksum-verified versions?
Show answer & explanation
Correct answer: B
The dependency lock file (
.terraform.lock.hcl) records the exact versions and checksums of all providers used. Committing this file ensures thatterraform initinstalls the exact same versions across all environments. - Question 4AdvancedSelect 2
Terraform Fundamentals · Explain how Terraform uses and manages state
Which of the following statements correctly describes how Terraform handles sensitive data, such as database passwords, within the state file? (Select TWO)
Show answer & explanation
Correct answers: A, D
Since the state file contains plain text secrets, the recommended best practice is to store it in a secure remote backend (like S3 with encryption or HCP Terraform) and restrict access permissions.
The
sensitiveflag only redacts the value from CLI output. The value is still stored in plain text in theterraform.tfstatefile to perform diffs. - Question 5Intermediate
Terraform Fundamentals · Write Terraform configuration using multiple providers
You need to configure a Terraform project that deploys resources into two different AWS regions (us-east-1 and eu-west-1) within the same
main.tffile. Which configuration pattern should you use?Show answer & explanation
Correct answer: D
To use multiple configurations for the same provider (like different regions), you define a default provider and additional providers with an
aliasargument. Resources targeting the secondary region referenceprovider = aws.alias_name. - Question 6Beginner
Terraform Fundamentals · Describe how Terraform uses providers
What is the primary function of the
.terraformdirectory created within your working directory?Show answer & explanation
Correct answer: A
The
.terraformdirectory is a local cache whereterraform initdownloads and installs the provider binaries and referenced modules required for the configuration.
Ready for the real thing?
The full TA-004 simulator has every exam-style question, timed mode, and instant scoring.