TA-004 Sample Questions

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.

  1. 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 provider blocks (e.g., one for aws and one for azurerm). Resources are then associated with the respective providers.

  2. Question 2Beginner

    Terraform Fundamentals · Install and version Terraform providers

    You have added a new provider to your existing versions.tf file. When you attempt to run terraform 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 init must be run to download the plugin binary to the .terraform directory and update the .terraform.lock.hcl file.

  3. 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 that terraform init installs the exact same versions across all environments.

  4. 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 sensitive flag only redacts the value from CLI output. The value is still stored in plain text in the terraform.tfstate file to perform diffs.

  5. 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.tf file. 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 alias argument. Resources targeting the secondary region reference provider = aws.alias_name.

  6. Question 6Beginner

    Terraform Fundamentals · Describe how Terraform uses providers

    What is the primary function of the .terraform directory created within your working directory?

    Show answer & explanation

    Correct answer: A

    The .terraform directory is a local cache where terraform init downloads 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.

Go to the TA-004 simulator →