HashiCorp Terraform Associate 004 Exam Dumps, Practice Test Questions

100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!

HashiCorp Terraform Associate 004 Premium Bundle
$64.98
$54.98

Terraform Associate 004 Premium Bundle

  • Premium File: 167 Questions & Answers. Last update: Nov 9, 2026
  • Study Guide: 285 Pages
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates

Terraform Associate 004 Premium Bundle

HashiCorp Terraform Associate 004 Premium Bundle
  • Premium File: 167 Questions & Answers. Last update: Nov 9, 2026
  • Study Guide: 285 Pages
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates
$64.98
$54.98

HashiCorp Terraform Associate 004 Practice Test 4

Question 30

A Terraform platform team is coordinating 3 independent decisions. Workstream A: A company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages. and Workstream B: A deployment needs separate port numbers per environment and a documented default for developer sandboxes. and Workstream C: A developer uses a fresh local Terraform directory with no backend block and asks where state will be written after apply. Select exactly 3 actions, one addressing each distinct workstream.

  1. Declare an input variable with type number and an appropriate default, overriding it per environment when needed.
  2. Inspect terraform plan -replace=ADDRESS and review any downstream dependencies before applying.
  3. Pass a different root provider configuration into each module call through its providers map.
  4. Use terraform state list to enumerate addresses in the selected state.
  5. Select suitable Azure and monitoring providers and declare both systems through one Terraform root module.
  6. Expect the default local backend to manage a terraform.tfstate file in the working directory.

Explanation

Correct Answers

A:

For the workstream in which a deployment needs separate port numbers per environment and a documented default for developer sandboxes, use this action: Declare an input variable with type number and an appropriate default, overriding it per environment when needed. Input variables parameterize a module; outputs report values out of the module. Verify: Plans show environment-specific port values while preserving the declared type constraint. Limitation: Defaults should not embed production secrets or bypass review of production-specific values.

E:

For the workstream in which a company uses Azure for application workloads and a SaaS provider for monitoring, and wants to avoid managing two separate IaC languages, use this action: Select suitable Azure and monitoring providers and declare both systems through one Terraform root module. Providers translate Terraform's declarative configuration into service-specific resource operations. Verify: Plan output contains the cloud deployment and monitoring integrations with clear provider ownership. Limitation: Terraform does not replace vendor-specific API capabilities; the respective providers expose what is supported.

F:

For the workstream in which a developer uses a fresh local Terraform directory with no backend block and asks where state will be written after apply, use this action: Expect the default local backend to manage a terraform.tfstate file in the working directory. Without an alternate backend or cloud integration, Terraform defaults to local state storage. Verify: A successful local apply creates or updates a locally persisted state snapshot for the selected workspace. Limitation: State can contain sensitive values and should be protected against accidental exposure or competing writers.

Incorrect Answers

B:

This action is appropriate instead for a different, unlisted requirement: A deployment operator needs to replace a single degraded instance deliberately while keeping its resource address. It would be checked by: The proposed plan marks that particular resource instance for replacement. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

C:

This action is appropriate instead for a different, unlisted requirement: A security team calls the same reusable child module twice, once under each of two cloud accounts. It would be checked by: Each module instance is associated with the correct account provider during plan. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

D:

This action is appropriate instead for a different, unlisted requirement: A release engineer needs the resource addresses Terraform currently manages without printing secrets from state. It would be checked by: The command outputs the expected resource instance addresses for further inspection. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

Question 31

An infrastructure team faces this specific situation: A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. Which Terraform action most directly satisfies the requirement?

  1. Set provider = aws.secondary on that resource, referencing the aliased provider configuration.
  2. Import the existing bucket into an appropriate resource address after writing matching configuration.
  3. Explain that Terraform compares current configuration with state bindings and plans to reconcile deleted declarations.
  4. Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible.

Explanation

Correct Answer

D:

Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible. The lock file preserves provider dependency selections within declared compatibility constraints. Verify: The chosen provider version and checksums are recorded in the lock file after initialization. Limitation: The dependency lock file locks provider selections, not an immutable Terraform CLI binary version.

Incorrect Answers

A:

This is linked to a different situation: A configuration has two aliases of the same cloud provider and both use different regions; one resource must be created outside the default region. There the relevant decision is: Set provider = aws.secondary on that resource, referencing the aliased provider configuration. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant decision is: Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. There the relevant decision is: Import the existing bucket into an appropriate resource address after writing matching configuration. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant decision is: Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An operator asks why deleting one resource stanza from a configuration can cause a production object to be proposed for destruction. There the relevant decision is: Explain that Terraform compares current configuration with state bindings and plans to reconcile deleted declarations. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant decision is: Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible. It would therefore not resolve or assess the case as stated.

Question 32

A reviewer is confirming a change for the following use case: A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. The implementation follows this approach: Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible. Which observation or acceptance test most directly verifies the intended result?

  1. Init obtains the required plugin; plan uses the configured provider instance for API calls.
  2. A plan shows the bound object as no longer desired when its resource address disappears from configuration.
  3. The chosen provider version and checksums are recorded in the lock file after initialization.
  4. The planned resource address resolves through the secondary provider while unqualified resources use the default.

Explanation

Correct Answer

C:

Acceptance evidence: The chosen provider version and checksums are recorded in the lock file after initialization. It validates the proposed action, commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible, because the lock file preserves provider dependency selections within declared compatibility constraints. Remaining limitation: The dependency lock file locks provider selections, not an immutable Terraform CLI binary version.

Incorrect Answers

A:

This is linked to a different situation: An engineer thinks the provider block installs the AWS provider and a resource block selects the AWS account by itself. There the relevant acceptance is: Init obtains the required plugin; plan uses the configured provider instance for API calls. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant acceptance is: The chosen provider version and checksums are recorded in the lock file after initialization. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: An operator asks why deleting one resource stanza from a configuration can cause a production object to be proposed for destruction. There the relevant acceptance is: A plan shows the bound object as no longer desired when its resource address disappears from configuration. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant acceptance is: The chosen provider version and checksums are recorded in the lock file after initialization. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A configuration has two aliases of the same cloud provider and both use different regions; one resource must be created outside the default region. There the relevant acceptance is: The planned resource address resolves through the secondary provider while unqualified resources use the default. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant acceptance is: The chosen provider version and checksums are recorded in the lock file after initialization. It would therefore not resolve or assess the case as stated.

Question 33

Consider a proposed solution for this requirement: A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. The team plans to do the following: Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible. Which limitation or operational caveat must remain in the review?

  1. Aliased provider instances are not inherited automatically by a child module.
  2. The dependency lock file locks provider selections, not an immutable Terraform CLI binary version.
  3. Import does not invent complete desired configuration or guarantee a no-op plan.
  4. State may include confidential values even when CLI output hides sensitive variable contents.

Explanation

Correct Answer

B:

The limitation is the dependency lock file locks provider selections, not an immutable Terraform CLI binary version. The proposed change is commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible. Validate it by checking the chosen provider version and checksums are recorded in the lock file after initialization. The lock file preserves provider dependency selections within declared compatibility constraints.

Incorrect Answers

A:

This is linked to a different situation: A child network module expects two AWS provider aliases, but the root module has only passed its default provider. There the relevant limitation is: Aliased provider instances are not inherited automatically by a child module. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant limitation is: The dependency lock file locks provider selections, not an immutable Terraform CLI binary version. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. There the relevant limitation is: Import does not invent complete desired configuration or guarantee a no-op plan. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant limitation is: The dependency lock file locks provider selections, not an immutable Terraform CLI binary version. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A team considers keeping .terraform.lock.hcl in a secrets vault because it thinks the file is the primary infrastructure state store. There the relevant limitation is: State may include confidential values even when CLI output hides sensitive variable contents. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant limitation is: The dependency lock file locks provider selections, not an immutable Terraform CLI binary version. It would therefore not resolve or assess the case as stated.

Question 34

The team is reviewing a Terraform implementation for this case: A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Assume required_providers constraints alone always choose the identical provider build for every run.
  2. Use a resource type label as a replacement for explicit provider endpoint or account configuration.
  3. Edit a JSON state file by hand as the normal way to make an unmanaged bucket Terraform-managed.
  4. Write static credentials into a versioned provider block because Terraform marks all input strings secret.

Explanation

Correct Answer

A:

Reject the assumption: Assume required_providers constraints alone always choose the identical provider build for every run. Instead, commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible. The lock file preserves provider dependency selections within declared compatibility constraints. Acceptance evidence: The chosen provider version and checksums are recorded in the lock file after initialization.

Incorrect Answers

B:

This is linked to a different situation: An engineer thinks the provider block installs the AWS provider and a resource block selects the AWS account by itself. There the relevant misconception is: Use a resource type label as a replacement for explicit provider endpoint or account configuration. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant misconception is: Assume required_providers constraints alone always choose the identical provider build for every run. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. There the relevant misconception is: Edit a JSON state file by hand as the normal way to make an unmanaged bucket Terraform-managed. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant misconception is: Assume required_providers constraints alone always choose the identical provider build for every run. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A newly introduced provider plugin needs credentials but the team wants to avoid including long-lived secrets in tracked files. There the relevant misconception is: Write static credentials into a versioned provider block because Terraform marks all input strings secret. For the question's actual requirement — A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. — the specifically relevant misconception is: Assume required_providers constraints alone always choose the identical provider build for every run. It would therefore not resolve or assess the case as stated.

Question 35

A Terraform platform team is coordinating 2 independent decisions. Workstream A: A team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers. and Workstream B: An operations team must surface a load balancer endpoint after apply so downstream jobs can consume it. Select exactly 2 actions, one addressing each distinct workstream.

  1. Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible.
  2. Use terraform show -json on the state or saved plan with proper access controls.
  3. Define a root output whose value references the managed load balancer's endpoint attribute.
  4. Configure an appropriate supported remote backend with secure access and locking rather than emailing terraform.tfstate.
  5. Back up the current state and use terraform init -migrate-state when moving to the newly configured backend.

Explanation

Correct Answers

A:

For the workstream in which a team pins the AWS provider below 6.0 but a new contractor runs init and unexpectedly resolves a higher patch than other developers, use this action: Commit .terraform.lock.hcl and use required_providers version constraints to keep provider selection reproducible. The lock file preserves provider dependency selections within declared compatibility constraints. Verify: The chosen provider version and checksums are recorded in the lock file after initialization. Limitation: The dependency lock file locks provider selections, not an immutable Terraform CLI binary version.

C:

For the workstream in which an operations team must surface a load balancer endpoint after apply so downstream jobs can consume it, use this action: Define a root output whose value references the managed load balancer's endpoint attribute. Output blocks expose evaluated results and can depend on managed resource attributes. Verify: After apply, terraform output reports the expected endpoint from state. Limitation: An output does not create the referenced endpoint, and sensitive output values need safe handling.

Incorrect Answers

B:

This option addresses a separate requirement: An engineer wants a machine-readable view of the current Terraform state while building an inventory report. Evidence for that other requirement would be the JSON structure can be parsed for relevant addresses and outputs by authorized tooling; neither listed workstream asks for it.

D:

This option addresses a separate requirement: A team's state file is stored on a laptop and must be shared across several engineers without copying it manually after every change. Evidence for that other requirement would be multiple team members read one central state snapshot and serialized operations when the backend supports locking; neither listed workstream asks for it.

E:

This option addresses a separate requirement: A migration changes a backend location but the team must preserve all existing state bindings. Evidence for that other requirement would be the destination backend reflects the prior managed resource addresses and lineage after migration; neither listed workstream asks for it.

Question 36

An infrastructure team faces this specific situation: A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. Which Terraform action most directly satisfies the requirement?

  1. Declare separate supported Kubernetes and DNS providers and use their respective resource types in the same root module.
  2. Pass a different root provider configuration into each module call through its providers map.
  3. Declare installation metadata in required_providers and put operational region or endpoint settings in provider configuration.
  4. Run terraform init -upgrade after reviewing the intended provider compatibility change.

Explanation

Correct Answer

D:

Run terraform init -upgrade after reviewing the intended provider compatibility change. Initialization with -upgrade reconsideres allowed plugin versions instead of honoring the previous lock selection. Verify: The updated .terraform.lock.hcl records the newly selected compatible provider and its checksums. Limitation: Upgrading may change provider behavior, so review plans and release notes before applying.

Incorrect Answers

A:

This is linked to a different situation: A newly created project uses both a Kubernetes cluster and cloud DNS records, and the same release should manage them coherently. There the relevant decision is: Declare separate supported Kubernetes and DNS providers and use their respective resource types in the same root module. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant decision is: Run terraform init -upgrade after reviewing the intended provider compatibility change. It would therefore not resolve or assess the case as stated.

B:

This is linked to a different situation: A security team calls the same reusable child module twice, once under each of two cloud accounts. There the relevant decision is: Pass a different root provider configuration into each module call through its providers map. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant decision is: Run terraform init -upgrade after reviewing the intended provider compatibility change. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An engineer thinks the provider block installs the AWS provider and a resource block selects the AWS account by itself. There the relevant decision is: Declare installation metadata in required_providers and put operational region or endpoint settings in provider configuration. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant decision is: Run terraform init -upgrade after reviewing the intended provider compatibility change. It would therefore not resolve or assess the case as stated.

Question 37

A reviewer is confirming a change for the following use case: A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. The implementation follows this approach: Run terraform init -upgrade after reviewing the intended provider compatibility change. Which observation or acceptance test most directly verifies the intended result?

  1. The state lists the imported address, and a subsequent plan can be evaluated for unintended differences.
  2. The updated .terraform.lock.hcl records the newly selected compatible provider and its checksums.
  3. The provider authenticates through the supported runtime identity without secrets appearing in committed configuration.
  4. Each module instance is associated with the correct account provider during plan.

Explanation

Correct Answer

B:

Acceptance evidence: The updated .terraform.lock.hcl records the newly selected compatible provider and its checksums. It validates the proposed action, run terraform init -upgrade after reviewing the intended provider compatibility change, because initialization with -upgrade reconsideres allowed plugin versions instead of honoring the previous lock selection. Remaining limitation: Upgrading may change provider behavior, so review plans and release notes before applying.

Incorrect Answers

A:

This is linked to a different situation: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. There the relevant acceptance is: The state lists the imported address, and a subsequent plan can be evaluated for unintended differences. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant acceptance is: The updated .terraform.lock.hcl records the newly selected compatible provider and its checksums. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A newly introduced provider plugin needs credentials but the team wants to avoid including long-lived secrets in tracked files. There the relevant acceptance is: The provider authenticates through the supported runtime identity without secrets appearing in committed configuration. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant acceptance is: The updated .terraform.lock.hcl records the newly selected compatible provider and its checksums. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A security team calls the same reusable child module twice, once under each of two cloud accounts. There the relevant acceptance is: Each module instance is associated with the correct account provider during plan. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant acceptance is: The updated .terraform.lock.hcl records the newly selected compatible provider and its checksums. It would therefore not resolve or assess the case as stated.

Question 38

Consider a proposed solution for this requirement: A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. The team plans to do the following: Run terraform init -upgrade after reviewing the intended provider compatibility change. Which limitation or operational caveat must remain in the review?

  1. Upgrading may change provider behavior, so review plans and release notes before applying.
  2. The exact environment variable or identity mechanism is provider-specific and must be checked in its documentation.
  3. Import does not invent complete desired configuration or guarantee a no-op plan.
  4. Provider settings do not guarantee permission to create any resource without valid credentials and IAM rights.

Explanation

Correct Answer

A:

The limitation is upgrading may change provider behavior, so review plans and release notes before applying. The proposed change is run terraform init -upgrade after reviewing the intended provider compatibility change. Validate it by checking the updated .terraform.lock.hcl records the newly selected compatible provider and its checksums. Initialization with -upgrade reconsideres allowed plugin versions instead of honoring the previous lock selection.

Incorrect Answers

B:

This is linked to a different situation: A newly introduced provider plugin needs credentials but the team wants to avoid including long-lived secrets in tracked files. There the relevant limitation is: The exact environment variable or identity mechanism is provider-specific and must be checked in its documentation. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant limitation is: Upgrading may change provider behavior, so review plans and release notes before applying. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: A storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. There the relevant limitation is: Import does not invent complete desired configuration or guarantee a no-op plan. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant limitation is: Upgrading may change provider behavior, so review plans and release notes before applying. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: An engineer thinks the provider block installs the AWS provider and a resource block selects the AWS account by itself. There the relevant limitation is: Provider settings do not guarantee permission to create any resource without valid credentials and IAM rights. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant limitation is: Upgrading may change provider behavior, so review plans and release notes before applying. It would therefore not resolve or assess the case as stated.

Question 39

The team is reviewing a Terraform implementation for this case: A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. Which tempting assumption would be specifically incorrect for this proposed implementation?

  1. Delete state files to force a provider upgrade rather than updating dependency selections.
  2. Expect every resource to automatically use whichever provider alias was declared last.
  3. Assume removing a resource block is a harmless change to documentation with no planned infrastructure effect.
  4. Assume module input variables alone can redirect all provider API calls without a provider mapping.

Explanation

Correct Answer

A:

Reject the assumption: Delete state files to force a provider upgrade rather than updating dependency selections. Instead, run terraform init -upgrade after reviewing the intended provider compatibility change. Initialization with -upgrade reconsideres allowed plugin versions instead of honoring the previous lock selection. Acceptance evidence: The updated .terraform.lock.hcl records the newly selected compatible provider and its checksums.

Incorrect Answers

B:

This is linked to a different situation: A configuration has two aliases of the same cloud provider and both use different regions; one resource must be created outside the default region. There the relevant misconception is: Expect every resource to automatically use whichever provider alias was declared last. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant misconception is: Delete state files to force a provider upgrade rather than updating dependency selections. It would therefore not resolve or assess the case as stated.

C:

This is linked to a different situation: An operator asks why deleting one resource stanza from a configuration can cause a production object to be proposed for destruction. There the relevant misconception is: Assume removing a resource block is a harmless change to documentation with no planned infrastructure effect. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant misconception is: Delete state files to force a provider upgrade rather than updating dependency selections. It would therefore not resolve or assess the case as stated.

D:

This is linked to a different situation: A security team calls the same reusable child module twice, once under each of two cloud accounts. There the relevant misconception is: Assume module input variables alone can redirect all provider API calls without a provider mapping. For the question's actual requirement — A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. — the specifically relevant misconception is: Delete state files to force a provider upgrade rather than updating dependency selections. It would therefore not resolve or assess the case as stated.

Question 40

A Terraform platform team is coordinating 3 independent decisions. Workstream A: A project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file. and Workstream B: A deployment job must supply different nonsecret inputs for each pipeline run without editing source-controlled HCL. and Workstream C: An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. Select exactly 3 actions, one addressing each distinct workstream.

  1. Ignore .terraform and protect state while committing the intended HCL and provider dependency lock file.
  2. Pass values through appropriate .tfvars files or documented TF_VAR_name environment variables.
  3. Run terraform init -upgrade after reviewing the intended provider compatibility change.
  4. Declare resources through separate compatible providers in one Terraform configuration, with references for dependencies.
  5. Use a Terraform root module that explicitly declares tracked resources and reconcile it through Terraform state.
  6. Review the HCL change through version control and inspect a Terraform execution plan before authorized apply.

Explanation

Correct Answers

A:

For the workstream in which an engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings, use this action: Ignore .terraform and protect state while committing the intended HCL and provider dependency lock file. The initialization cache is machine-local and may carry sensitive backend metadata. Verify: The repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets. Limitation: A repo may use a remote backend, but local initialization data can still expose backend credentials.

B:

For the workstream in which a deployment job must supply different nonsecret inputs for each pipeline run without editing source-controlled HCL, use this action: Pass values through appropriate .tfvars files or documented TF_VAR_name environment variables. Terraform evaluates input values separately from the module's reusable declarations. Verify: The plan uses the expected values while the shared module source remains unchanged. Limitation: Precedence between inputs must be understood and secret values still need secure sourcing.

C:

For the workstream in which a project intentionally needs a newer provider version allowed by its constraints, but init keeps reusing the version recorded in the lock file, use this action: Run terraform init -upgrade after reviewing the intended provider compatibility change. Initialization with -upgrade reconsideres allowed plugin versions instead of honoring the previous lock selection. Verify: The updated .terraform.lock.hcl records the newly selected compatible provider and its checksums. Limitation: Upgrading may change provider behavior, so review plans and release notes before applying.

Incorrect Answers

D:

This action is appropriate instead for a different, unlisted requirement: A logistics firm needs a private data-center virtual machine and a public-cloud DNS record managed from one reviewed release. It would be checked by: A single plan lists the intended private and public resource actions under their respective providers. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

E:

This action is appropriate instead for a different, unlisted requirement: An audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure. It would be checked by: The plan and state distinguish managed resource instances from unmanaged manual purchases. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

F:

This action is appropriate instead for a different, unlisted requirement: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. It would be checked by: A pull request includes configuration differences and a plan describing expected resource mutations. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.

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

UP

SPECIAL OFFER: GET 10% OFF

This is ONE TIME OFFER

ExamSnap Discount Offer
Enter Your Email Address to Receive Your 10% Off Discount Code

A confirmation link will be sent to this email address to verify your login. *We value your privacy. We will not rent or sell your email address.

Download Free Demo of VCE Exam Simulator

Experience Avanset VCE Exam Simulator for yourself.

Simply submit your e-mail address below to get started with our interactive software demo of your free trial.

Free Demo Limits: In the demo version you will be able to access only first 5 questions from exam.