Practice Exams:

HashiCorp Terraform Associate 004 Dumps

EXAM: HashiCorp Certified: Terraform Associate (004)
Verified By Experts
Premium Bundle
$40.00
$59.97 $99.97

Terraform Associate 004 Premium Bundle


  • Premium File 167 Questions & Answers
  • Training Course 118 Lectures
  • Study Guide 285 Pages

HashiCorp Terraform Associate 004 Practice Test 7

Question 60

A manufacturing group uses an on-premises virtualization cluster plus a cloud backup account and needs a predictable infrastructure change process. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. Verify: Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account.
  2. Implement: Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production. Verify: Create a pull request that changes a nonproduction tag, attach the expected plan, and verify the reviewer can trace the eventual apply to that commit.
  3. Implement: Declare resource configurations through appropriate provider plugins for each cloud while keeping shared orchestration in Terraform and cloud-specific arguments explicit. Verify: Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account.
  4. Implement: Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. Verify: Plan a disposable resource in each of two cloud test accounts and confirm that provider selection, regions and attributes resolve to the intended APIs.

Answer & Explanations

Correct answer: A

A.

The question is set in this situation: A manufacturing group uses an on-premises virtualization cluster plus a cloud backup account and needs a predictable infrastructure change process. Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. Confirm it through this test: Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account. A Terraform working directory can coordinate plugins for remote systems with different endpoints, but only resources supported by each provider can be managed through its API.

B.

This action/test pair addresses “Require version control and review for infrastructure changes”. Commit HCL changes to a version-controlled repository and have peers inspect the resulting plan before an authorized apply updates production. Create a pull request that changes a nonproduction tag, attach the expected plan, and verify the reviewer can trace the eventual apply to that commit. The case instead calls for: Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit.

C.

The question is set in this situation: A manufacturing group uses an on-premises virtualization cluster plus a cloud backup account and needs a predictable infrastructure change process. The test would be relevant: Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account. But the offered implementation—Declare resource configurations through appropriate provider plugins for each cloud while keeping shared orchestration in Terraform and cloud-specific arguments explicit.—addresses “Model different clouds using providers without assuming identical resources”. The action needed here is: Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit.

D.

The question is set in this situation: A manufacturing group uses an on-premises virtualization cluster plus a cloud backup account and needs a predictable infrastructure change process. The action is applicable: Compose supported providers for public cloud infrastructure and a private virtualization or DNS system, keeping credentials, state and dependencies explicit. But its proposed test—Plan a disposable resource in each of two cloud test accounts and confirm that provider selection, regions and attributes resolve to the intended APIs.—addresses “Model different clouds using providers without assuming identical resources”. This requirement is confirmed instead by: Plan a disposable public subnet and a private DNS record, then verify each change is attributed to the correct configured provider and account.

Question 61

A finance platform's deployment pipeline recently selected a new provider release with different behavior despite no HCL source change. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion.
  2. Declare separate provider blocks with an alias and use the resource provider meta-argument to bind individual resources to the intended region or account.
  3. Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform.
  4. Use a compatible provider with documented resource schemas to translate Terraform configuration into authorized API operations for the target service.

Answer & Explanations

Correct answer: C

A.

Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion. This addresses “Upgrade a selected provider deliberately using terraform init -upgrade”, where the governing principle is: The upgrade option allows choosing newer provider versions that satisfy configured constraints; a normal locked initialization typically reuses existing selections. The stated case instead calls for: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

B.

Declare separate provider blocks with an alias and use the resource provider meta-argument to bind individual resources to the intended region or account. This addresses “Select aliased provider configurations for a second region”, where the governing principle is: Terraform selects the default provider unless an explicit alias is passed; each aliased instance carries its own endpoints and credential context. The stated case instead calls for: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

C.

Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform. Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines. Verify the result with this test: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

D.

Use a compatible provider with documented resource schemas to translate Terraform configuration into authorized API operations for the target service. This addresses “Understand provider plugins as the bridge to service APIs”, where the governing principle is: Terraform Core computes dependencies and manages plans while provider plugins implement resource read, create, update and delete behavior for remote APIs. The stated case instead calls for: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

Question 62

A finance platform's deployment pipeline recently selected a new provider release with different behavior despite no HCL source change. The infrastructure engineer proposes this change: Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform. Which mechanism explains why it works?

  1. Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.
  2. Terraform selects the default provider unless an explicit alias is passed; each aliased instance carries its own endpoints and credential context.
  3. Terraform Core computes dependencies and manages plans while provider plugins implement resource read, create, update and delete behavior for remote APIs.
  4. The upgrade option allows choosing newer provider versions that satisfy configured constraints; a normal locked initialization typically reuses existing selections.

Answer & Explanations

Correct answer: A

A.

Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines. The corresponding implementation is: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

B.

Terraform selects the default provider unless an explicit alias is passed; each aliased instance carries its own endpoints and credential context. That explains “Select aliased provider configurations for a second region”, not the mechanism behind the described change. The relevant principle is: Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.

C.

Terraform Core computes dependencies and manages plans while provider plugins implement resource read, create, update and delete behavior for remote APIs. That explains “Understand provider plugins as the bridge to service APIs”, not the mechanism behind the described change. The relevant principle is: Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.

D.

The upgrade option allows choosing newer provider versions that satisfy configured constraints; a normal locked initialization typically reuses existing selections. That explains “Upgrade a selected provider deliberately using terraform init -upgrade”, not the mechanism behind the described change. The relevant principle is: Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.

Question 63

A finance platform's deployment pipeline recently selected a new provider release with different behavior despite no HCL source change. After implementing this change—Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform.—which test most directly validates its intended outcome?

  1. Compare .terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures.
  2. Inspect terraform providers and provider documentation, plan a test resource, and verify the appropriate remote API object is queried under the configured account.
  3. Plan two disposable resources with distinct provider aliases and verify the expected region and account are recorded for each object.
  4. Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

Answer & Explanations

Correct answer: D

A.

Compare.terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures. That would help test “Upgrade a selected provider deliberately using terraform init -upgrade”, not the outcome required in this scenario. The relevant acceptance check is: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

B.

Inspect terraform providers and provider documentation, plan a test resource, and verify the appropriate remote API object is queried under the configured account. That would help test “Understand provider plugins as the bridge to service APIs”, not the outcome required in this scenario. The relevant acceptance check is: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

C.

Plan two disposable resources with distinct provider aliases and verify the expected region and account are recorded for each object. That would help test “Select aliased provider configurations for a second region”, not the outcome required in this scenario. The relevant acceptance check is: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

D.

Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version. This check is decisive because constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.

Question 64

A finance platform's deployment pipeline recently selected a new provider release with different behavior despite no HCL source change. Which proposed shortcut most directly risks nonreproducible plans or breaking provider upgrades between runs and should therefore be rejected?

  1. Declare a second provider alias but forget to associate the regional resource with it, assuming Terraform selects the nearest geographic region.
  2. Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day.
  3. Change a version constraint in production and apply immediately without inspecting the selected provider binary or resulting plan changes.
  4. Assume Terraform Core itself knows every third-party API argument and can create arbitrary resources without a provider plugin.

Answer & Explanations

Correct answer: B

A.

Declare a second provider alias but forget to associate the regional resource with it, assuming Terraform selects the nearest geographic region. That shortcut risks creation of infrastructure in the wrong region or account. Here the specific shortcut is: Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day.

B.

Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day. The foreseeable failure is nonreproducible plans or breaking provider upgrades between runs. The safer response is: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

C.

Change a version constraint in production and apply immediately without inspecting the selected provider binary or resulting plan changes. That shortcut risks unexpected destructive changes from unreviewed provider dependency upgrades. Here the specific shortcut is: Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day.

D.

Assume Terraform Core itself knows every third-party API argument and can create arbitrary resources without a provider plugin. That shortcut risks unknown resource type errors or unintended infrastructure assumptions from missing provider schemas. Here the specific shortcut is: Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day.

Question 65

A finance platform's deployment pipeline recently selected a new provider release with different behavior despite no HCL source change. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion. Verify: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.
  2. Implement: Use a compatible provider with documented resource schemas to translate Terraform configuration into authorized API operations for the target service. Verify: Inspect terraform providers and provider documentation, plan a test resource, and verify the appropriate remote API object is queried under the configured account.
  3. Implement: Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform. Verify: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.
  4. Implement: Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform. Verify: Compare .terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures.

Answer & Explanations

Correct answer: C

A.

The test would be relevant: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version. But the offered implementation—Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion.—addresses “Upgrade a selected provider deliberately using terraform init -upgrade”. The action needed here is: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

B.

This action/test pair addresses “Understand provider plugins as the bridge to service APIs”. Use a compatible provider with documented resource schemas to translate Terraform configuration into authorized API operations for the target service. Inspect terraform providers and provider documentation, plan a test resource, and verify the appropriate remote API object is queried under the configured account. The case instead calls for: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

C.

Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform. Confirm it through this test: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version. Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.

D.

The action is applicable: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform. But its proposed test—Compare.terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures.—addresses “Upgrade a selected provider deliberately using terraform init -upgrade”. This requirement is confirmed instead by: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

Question 66

A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Authenticate provider plugins using approved workload identity or environment credential mechanisms and grant only the required service permissions.
  2. Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion.
  3. Configure required provider aliases in a child module's configuration_aliases when necessary and pass explicit provider mappings from the calling module.
  4. Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform.

Answer & Explanations

Correct answer: D

A.

Authenticate provider plugins using approved workload identity or environment credential mechanisms and grant only the required service permissions. This addresses “Keep provider credentials out of committed HCL code”, where the governing principle is: Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state. The stated case instead calls for: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

B.

The question is set in this situation: A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion. This addresses “Upgrade a selected provider deliberately using terraform init -upgrade”, where the governing principle is: The upgrade option allows choosing newer provider versions that satisfy configured constraints; a normal locked initialization typically reuses existing selections. The stated case instead calls for: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

C.

Configure required provider aliases in a child module's configuration_aliases when necessary and pass explicit provider mappings from the calling module. This addresses “Pass nondefault provider aliases explicitly into child modules”, where the governing principle is: Modules can inherit default providers but nondefault configurations must be passed deliberately; otherwise resources may resolve to an unintended default or lack configuration. The stated case instead calls for: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

D.

The question is set in this situation: A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform. Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines. Verify the result with this test: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

Question 67

A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. The infrastructure engineer proposes this change: Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform. Which mechanism explains why it works?

  1. The upgrade option allows choosing newer provider versions that satisfy configured constraints; a normal locked initialization typically reuses existing selections.
  2. Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.
  3. Modules can inherit default providers but nondefault configurations must be passed deliberately; otherwise resources may resolve to an unintended default or lack configuration.
  4. Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state.

Answer & Explanations

Correct answer: B

A.

The question is set in this situation: A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. The upgrade option allows choosing newer provider versions that satisfy configured constraints; a normal locked initialization typically reuses existing selections. That explains “Upgrade a selected provider deliberately using terraform init -upgrade”, not the mechanism behind the described change. The relevant principle is: Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.

B.

The question is set in this situation: A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines. The corresponding implementation is: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

C.

Modules can inherit default providers but nondefault configurations must be passed deliberately; otherwise resources may resolve to an unintended default or lack configuration. That explains “Pass nondefault provider aliases explicitly into child modules”, not the mechanism behind the described change. The relevant principle is: Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.

D.

Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state. That explains “Keep provider credentials out of committed HCL code”, not the mechanism behind the described change. The relevant principle is: Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.

Question 68

A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. After implementing this change—Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform.—which test most directly validates its intended outcome?

  1. Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.
  2. Compare .terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures.
  3. Run an isolated plan under a restricted CI identity, confirm approved reads succeed and a protected out-of-scope API call is denied.
  4. Run terraform validate and a sandbox plan with a module using two aliases and inspect which account each module-managed resource targets.

Answer & Explanations

Correct answer: A

A.

The question is set in this situation: A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version. This check is decisive because constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.

B.

The question is set in this situation: A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. Compare.terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures. That would help test “Upgrade a selected provider deliberately using terraform init -upgrade”, not the outcome required in this scenario. The relevant acceptance check is: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

C.

Run an isolated plan under a restricted CI identity, confirm approved reads succeed and a protected out-of-scope API call is denied. That would help test “Keep provider credentials out of committed HCL code”, not the outcome required in this scenario. The relevant acceptance check is: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

D.

Run terraform validate and a sandbox plan with a module using two aliases and inspect which account each module-managed resource targets. That would help test “Pass nondefault provider aliases explicitly into child modules”, not the outcome required in this scenario. The relevant acceptance check is: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

Question 69

A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. Which proposed shortcut most directly risks nonreproducible plans or breaking provider upgrades between runs and should therefore be rejected?

  1. Change a version constraint in production and apply immediately without inspecting the selected provider binary or resulting plan changes.
  2. Assume any child module automatically receives every caller provider alias, without declaring or mapping those provider instances.
  3. Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day.
  4. Commit a project-owner token as a literal provider argument so every developer and fork of the repository can run terraform apply.

Answer & Explanations

Correct answer: C

A.

The question is set in this situation: A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. Change a version constraint in production and apply immediately without inspecting the selected provider binary or resulting plan changes. That shortcut risks unexpected destructive changes from unreviewed provider dependency upgrades. Here the specific shortcut is: Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day.

B.

Assume any child module automatically receives every caller provider alias, without declaring or mapping those provider instances. That shortcut risks module resources deployed under a wrong provider configuration. Here the specific shortcut is: Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day.

C.

The question is set in this situation: A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day. The foreseeable failure is nonreproducible plans or breaking provider upgrades between runs. The safer response is: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

D.

Commit a project-owner token as a literal provider argument so every developer and fork of the repository can run terraform apply. That shortcut risks persistent cloud credential exposure through version history and CI artifacts. Here the specific shortcut is: Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day.

Question 70

A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion. Verify: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.
  2. Implement: Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform. Verify: Compare .terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures.
  3. Implement: Configure required provider aliases in a child module's configuration_aliases when necessary and pass explicit provider mappings from the calling module. Verify: Run terraform validate and a sandbox plan with a module using two aliases and inspect which account each module-managed resource targets.
  4. Implement: Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform. Verify: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

Answer & Explanations

Correct answer: D

A.

The question is set in this situation: A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. The test would be relevant: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version. But the offered implementation—Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion.—addresses “Upgrade a selected provider deliberately using terraform init -upgrade”. The action needed here is: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

B.

The question is set in this situation: A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. The action is applicable: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform. But its proposed test—Compare.terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures.—addresses “Upgrade a selected provider deliberately using terraform init -upgrade”. This requirement is confirmed instead by: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

C.

This action/test pair addresses “Pass nondefault provider aliases explicitly into child modules”. Configure required provider aliases in a child module's configuration_aliases when necessary and pass explicit provider mappings from the calling module. Run terraform validate and a sandbox plan with a module using two aliases and inspect which account each module-managed resource targets. The case instead calls for: Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform.

D.

The question is set in this situation: A school district wants developers on Linux and macOS to resolve the same approved Terraform provider version for routine changes. Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform. Confirm it through this test: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version. Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.

HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests