100% Latest & Updated HashiCorp Terraform Associate 004 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 420
A Terraform platform team is coordinating 3 independent decisions. Workstream A: A team's state file is stored on a laptop and must be shared across several engineers without copying it manually after every change. and Workstream B: A logistics firm needs a private data-center virtual machine and a public-cloud DNS record managed from one reviewed release. and Workstream C: A module uses a provider data source to find the newest image and a resource block to launch a VM from its returned identifier. Select exactly 3 actions, one addressing each distinct workstream.
- Declare aliases in the child required_providers and explicitly pass both in the parent module.providers mapping.
- Reference the selected data source attribute in the managed resource's image argument.
- Declare resources through separate compatible providers in one Terraform configuration, with references for dependencies.
- Import the existing bucket into an appropriate resource address after writing matching configuration.
- Configure an appropriate supported remote backend with secure access and locking rather than emailing terraform.tfstate.
- Specify the Git module source with the double-slash subdirectory syntax after the repository path.
Explanation
Correct Answers
B:For the workstream in which a module uses a provider data source to find the newest image and a resource block to launch a VM from its returned identifier, use this action: Reference the selected data source attribute in the managed resource's image argument. Data sources provide read-only values that can feed managed resource configuration. Verify: The plan resolves the image lookup and uses its ID in the VM resource configuration. Limitation: An automatically changing latest-image lookup may propose later VM replacements depending on resource schema.
C:For the workstream in which a logistics firm needs a private data-center virtual machine and a public-cloud DNS record managed from one reviewed release, use this action: Declare resources through separate compatible providers in one Terraform configuration, with references for dependencies. Terraform's provider model unifies the workflow while delegating API interactions to platform-specific plugins. Verify: A single plan lists the intended private and public resource actions under their respective providers. Limitation: Each endpoint still needs its own supported provider, authentication, connectivity, and permissions.
E:For the workstream in which a team's state file is stored on a laptop and must be shared across several engineers without copying it manually after every change, use this action: Configure an appropriate supported remote backend with secure access and locking rather than emailing terraform.tfstate. Central state storage reduces divergent management views across collaborators. Verify: Multiple team members read one central state snapshot and serialized operations when the backend supports locking. Limitation: Remote storage is only as safe as its access policy, encryption, versioning, and locking support.
Incorrect Answers
A:This action is appropriate instead for a different, unlisted requirement: A child module must receive two non-default provider aliases for cross-region VPN creation. It would be checked by: The child's plan uses the two exact provider instances rather than silently defaulting to one region. 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 storage bucket exists in the cloud, but Terraform proposes creating another bucket with the intended name because its state has no binding. It would be checked by: The state lists the imported address, and a subsequent plan can be evaluated for unintended differences. 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: A monorepo contains a reusable module within a subdirectory of a Git repository, and Terraform currently downloads the wrong root folder. It would be checked by: Initialization loads only the intended child configuration rooted at the named subdirectory. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
Question 421
An infrastructure team faces this specific situation: An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. Which Terraform action most directly satisfies the requirement?
- Ignore .terraform and protect state while committing the intended HCL and provider dependency lock file.
- Declare one backend block inside terraform and reinitialize the working directory.
- Back up the current state and use terraform init -migrate-state when moving to the newly configured backend.
- Let the state lock serialize operations and retry after the active writer finishes.
Explanation
Correct Answer
A: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.
Incorrect Answers
B:This is linked to a different situation: A new environment needs to save state in a specific shared backend, and the team attempts to write backend settings under a resource block. There the relevant decision is: Declare one backend block inside terraform and reinitialize the working directory. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant decision is: Ignore .terraform and protect state while committing the intended HCL and provider dependency lock file. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A migration changes a backend location but the team must preserve all existing state bindings. There the relevant decision is: Back up the current state and use terraform init -migrate-state when moving to the newly configured backend. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant decision is: Ignore .terraform and protect state while committing the intended HCL and provider dependency lock file. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. There the relevant decision is: Let the state lock serialize operations and retry after the active writer finishes. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant decision is: Ignore .terraform and protect state while committing the intended HCL and provider dependency lock file. It would therefore not resolve or assess the case as stated.
Question 422
A reviewer is confirming a change for the following use case: An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. The implementation follows this approach: Ignore .terraform and protect state while committing the intended HCL and provider dependency lock file. Which observation or acceptance test most directly verifies the intended result?
- State and root outputs synchronize with observed remote data without changing the cloud object itself.
- The repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets.
- A controlled test or backend documentation confirms a lock is obtained for state-mutating operations.
- terraform init reports the selected backend and plan reads the correct shared state.
Explanation
Correct Answer
B:Acceptance evidence: The repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets. It validates the proposed action, ignore .terraform and protect state while committing the intended HCL and provider dependency lock file, because the initialization cache is machine-local and may carry sensitive backend metadata. Remaining limitation: A repo may use a remote backend, but local initialization data can still expose backend credentials.
Incorrect Answers
A:This is linked to a different situation: A company intentionally altered remote settings and wants Terraform state to reflect the real objects without proposing configuration-driven remediation yet. There the relevant acceptance is: State and root outputs synchronize with observed remote data without changing the cloud object itself. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant acceptance is: The repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: An engineer asks whether selecting an S3 bucket as remote storage automatically guarantees supported state locking under every Terraform/backend version. There the relevant acceptance is: A controlled test or backend documentation confirms a lock is obtained for state-mutating operations. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant acceptance is: The repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A new environment needs to save state in a specific shared backend, and the team attempts to write backend settings under a resource block. There the relevant acceptance is: terraform init reports the selected backend and plan reads the correct shared state. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant acceptance is: The repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets. It would therefore not resolve or assess the case as stated.
Question 423
Consider a proposed solution for this requirement: An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. The team plans to do the following: Ignore .terraform and protect state while committing the intended HCL and provider dependency lock file. Which limitation or operational caveat must remain in the review?
- Misconfigured credentials or failed migration should block an apply rather than trigger new resource creation.
- Locking support depends on backend type; disabling locks invites state corruption.
- A repo may use a remote backend, but local initialization data can still expose backend credentials.
- Storage location alone does not prove the required locking mechanism is configured or supported.
Explanation
Correct Answer
C:The limitation is a repo may use a remote backend, but local initialization data can still expose backend credentials. The proposed change is ignore .terraform and protect state while committing the intended HCL and provider dependency lock file. Validate it by checking the repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets. The initialization cache is machine-local and may carry sensitive backend metadata.
Incorrect Answers
A:This is linked to a different situation: A migration changes a backend location but the team must preserve all existing state bindings. There the relevant limitation is: Misconfigured credentials or failed migration should block an apply rather than trigger new resource creation. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant limitation is: A repo may use a remote backend, but local initialization data can still expose backend credentials. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. There the relevant limitation is: Locking support depends on backend type; disabling locks invites state corruption. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant limitation is: A repo may use a remote backend, but local initialization data can still expose backend credentials. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: An engineer asks whether selecting an S3 bucket as remote storage automatically guarantees supported state locking under every Terraform/backend version. There the relevant limitation is: Storage location alone does not prove the required locking mechanism is configured or supported. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant limitation is: A repo may use a remote backend, but local initialization data can still expose backend credentials. It would therefore not resolve or assess the case as stated.
Question 424
The team is reviewing a Terraform implementation for this case: An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Use terraform init -reconfigure as if it always copies state to a new backend.
- Use a provider resource block as the place Terraform decides where its own state is stored.
- Commit .terraform/ to guarantee reproducibility and treat the directory as harmless source code.
- Assume command-line -backend-config secrets are never preserved after initialization.
Explanation
Correct Answer
C:Reject the assumption: Commit .terraform/ to guarantee reproducibility and treat the directory as harmless source code. Instead, 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. Acceptance evidence: The repository contains reviewed configuration and .terraform.lock.hcl, not transient cache or backend secrets.
Incorrect Answers
A:This is linked to a different situation: A migration changes a backend location but the team must preserve all existing state bindings. There the relevant misconception is: Use terraform init -reconfigure as if it always copies state to a new backend. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant misconception is: Commit .terraform/ to guarantee reproducibility and treat the directory as harmless source code. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A new environment needs to save state in a specific shared backend, and the team attempts to write backend settings under a resource block. There the relevant misconception is: Use a provider resource block as the place Terraform decides where its own state is stored. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant misconception is: Commit .terraform/ to guarantee reproducibility and treat the directory as harmless source code. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A security review finds AWS access keys passed in -backend-config and wants to reduce secret persistence in initialization files. There the relevant misconception is: Assume command-line -backend-config secrets are never preserved after initialization. For the question's actual requirement — An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. — the specifically relevant misconception is: Commit .terraform/ to guarantee reproducibility and treat the directory as harmless source code. It would therefore not resolve or assess the case as stated.
Question 425
A Terraform platform team is coordinating 2 independent decisions. Workstream A: An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. and Workstream B: An audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure. Select exactly 2 actions, one addressing each distinct workstream.
- Ignore .terraform and protect state while committing the intended HCL and provider dependency lock file.
- Use a provider-supported write-only argument, optionally supplied by an ephemeral value, with appropriate versioning.
- Use a Terraform root module that explicitly declares tracked resources and reconcile it through Terraform state.
- Declare map(string) as the input type and select an entry by key, such as var.instance_class["staging"].
- Use a valid git:: module source and an appropriate immutable reviewed ref, with the necessary credentials.
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.
C:For the workstream in which an audit team asks whether applying a YAML-looking file automatically turns ad hoc server purchases into managed infrastructure, use this action: Use a Terraform root module that explicitly declares tracked resources and reconcile it through Terraform state. Declarative configuration describes desired objects; state connects configuration addresses to real infrastructure instances. Verify: The plan and state distinguish managed resource instances from unmanaged manual purchases. Limitation: An IaC repository alone cannot retroactively adopt existing objects without an import or equivalent workflow.
Incorrect Answers
B:This option addresses a separate requirement: A database API supports a write-only password argument and the team must avoid persisting the initial password to state. Evidence for that other requirement would be the resource operation consumes the password while the Terraform plan and state omit the write-only value; neither listed workstream asks for it.
D:This option addresses a separate requirement: A configuration needs a map from environment names to individually selected instance classes, with each value a string. Evidence for that other requirement would be the selected environment returns the class value under the requested map key; neither listed workstream asks for it.
E:This option addresses a separate requirement: An infrastructure module is checked out from a private Git repository at a reviewed branch or tag, not published as a registry module. Evidence for that other requirement would be initialization checks out the intended Git module revision and the plan uses its configuration; neither listed workstream asks for it.
Question 426
An infrastructure team faces this specific situation: Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. Which Terraform action most directly satisfies the requirement?
- Ignore .terraform and protect state while committing the intended HCL and provider dependency lock file.
- Use supported environment-based backend credentials or identity rather than embedding credentials in backend configuration.
- Let the state lock serialize operations and retry after the active writer finishes.
- Use a reviewed removed block with destroy = false or a careful terraform state rm operation to forget its binding.
Explanation
Correct Answer
C:Let the state lock serialize operations and retry after the active writer finishes. State locking prevents concurrent writers from independently changing a shared snapshot. Verify: Only one run modifies the protected state at a time and the second safely waits or fails. Limitation: Locking support depends on backend type; disabling locks invites state corruption.
Incorrect Answers
A:This is linked to a different situation: An engineer wants to commit the local .terraform directory to source control because it contains provider caches and backend settings. There the relevant decision is: Ignore .terraform and protect state while committing the intended HCL and provider dependency lock file. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant decision is: Let the state lock serialize operations and retry after the active writer finishes. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A security review finds AWS access keys passed in -backend-config and wants to reduce secret persistence in initialization files. There the relevant decision is: Use supported environment-based backend credentials or identity rather than embedding credentials in backend configuration. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant decision is: Let the state lock serialize operations and retry after the active writer finishes. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A managed object should stop being controlled by Terraform while remaining physically available. There the relevant decision is: Use a reviewed removed block with destroy = false or a careful terraform state rm operation to forget its binding. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant decision is: Let the state lock serialize operations and retry after the active writer finishes. It would therefore not resolve or assess the case as stated.
Question 427
A reviewer is confirming a change for the following use case: Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. The implementation follows this approach: Let the state lock serialize operations and retry after the active writer finishes. Which observation or acceptance test most directly verifies the intended result?
- Terraform no longer lists the address as managed, while the remote object remains available.
- Backend initialization succeeds without static access keys embedded in .terraform or saved plan artifacts.
- The destination backend reflects the prior managed resource addresses and lineage after migration.
- Only one run modifies the protected state at a time and the second safely waits or fails.
Explanation
Correct Answer
D:Acceptance evidence: Only one run modifies the protected state at a time and the second safely waits or fails. It validates the proposed action, let the state lock serialize operations and retry after the active writer finishes, because state locking prevents concurrent writers from independently changing a shared snapshot. Remaining limitation: Locking support depends on backend type; disabling locks invites state corruption.
Incorrect Answers
A:This is linked to a different situation: A managed object should stop being controlled by Terraform while remaining physically available. There the relevant acceptance is: Terraform no longer lists the address as managed, while the remote object remains available. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant acceptance is: Only one run modifies the protected state at a time and the second safely waits or fails. It would therefore not resolve or assess the case as stated.
B:This is linked to a different situation: A security review finds AWS access keys passed in -backend-config and wants to reduce secret persistence in initialization files. There the relevant acceptance is: Backend initialization succeeds without static access keys embedded in .terraform or saved plan artifacts. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant acceptance is: Only one run modifies the protected state at a time and the second safely waits or fails. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A migration changes a backend location but the team must preserve all existing state bindings. There the relevant acceptance is: The destination backend reflects the prior managed resource addresses and lineage after migration. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant acceptance is: Only one run modifies the protected state at a time and the second safely waits or fails. It would therefore not resolve or assess the case as stated.
Question 428
Consider a proposed solution for this requirement: Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. The team plans to do the following: Let the state lock serialize operations and retry after the active writer finishes. Which limitation or operational caveat must remain in the review?
- Locking support depends on backend type; disabling locks invites state corruption.
- Refresh-only does not make configuration match reality or prevent later normal plans from proposing remediation.
- Migrating existing state to cloud-managed workspaces needs a controlled review and backup.
- Moved blocks need correct old/new addresses and should be reviewed for concurrent changes.
Explanation
Correct Answer
A:The limitation is locking support depends on backend type; disabling locks invites state corruption. The proposed change is let the state lock serialize operations and retry after the active writer finishes. Validate it by checking only one run modifies the protected state at a time and the second safely waits or fails. State locking prevents concurrent writers from independently changing a shared snapshot.
Incorrect Answers
B:This is linked to a different situation: A company intentionally altered remote settings and wants Terraform state to reflect the real objects without proposing configuration-driven remediation yet. There the relevant limitation is: Refresh-only does not make configuration match reality or prevent later normal plans from proposing remediation. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant limitation is: Locking support depends on backend type; disabling locks invites state corruption. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A Terraform configuration contains both a cloud block and a backend block while planning to use HCP Terraform remote execution. There the relevant limitation is: Migrating existing state to cloud-managed workspaces needs a controlled review and backup. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant limitation is: Locking support depends on backend type; disabling locks invites state corruption. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: A resource was renamed from aws_instance.app to aws_instance.frontend in HCL, but it is the same underlying VM. There the relevant limitation is: Moved blocks need correct old/new addresses and should be reviewed for concurrent changes. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant limitation is: Locking support depends on backend type; disabling locks invites state corruption. It would therefore not resolve or assess the case as stated.
Question 429
The team is reviewing a Terraform implementation for this case: Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. Which tempting assumption would be specifically incorrect for this proposed implementation?
- Assume command-line -backend-config secrets are never preserved after initialization.
- Retry with -lock=false while the other pipeline is actively writing the same state.
- Use terraform init -reconfigure as if it always copies state to a new backend.
- Assume unchanged Terraform files imply remote infrastructure cannot drift.
Explanation
Correct Answer
B:Reject the assumption: Retry with -lock=false while the other pipeline is actively writing the same state. Instead, let the state lock serialize operations and retry after the active writer finishes. State locking prevents concurrent writers from independently changing a shared snapshot. Acceptance evidence: Only one run modifies the protected state at a time and the second safely waits or fails.
Incorrect Answers
A:This is linked to a different situation: A security review finds AWS access keys passed in -backend-config and wants to reduce secret persistence in initialization files. There the relevant misconception is: Assume command-line -backend-config secrets are never preserved after initialization. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant misconception is: Retry with -lock=false while the other pipeline is actively writing the same state. It would therefore not resolve or assess the case as stated.
C:This is linked to a different situation: A migration changes a backend location but the team must preserve all existing state bindings. There the relevant misconception is: Use terraform init -reconfigure as if it always copies state to a new backend. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant misconception is: Retry with -lock=false while the other pipeline is actively writing the same state. It would therefore not resolve or assess the case as stated.
D:This is linked to a different situation: An operations team edits cloud VM tags manually, and normal Terraform plan shows an unexpected change even though HCL has not changed. There the relevant misconception is: Assume unchanged Terraform files imply remote infrastructure cannot drift. For the question's actual requirement — Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. — the specifically relevant misconception is: Retry with -lock=false while the other pipeline is actively writing the same state. It would therefore not resolve or assess the case as stated.
Question 430
A Terraform platform team is coordinating 3 independent decisions. Workstream A: Two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure. and Workstream B: An operations group wants four engineers to propose a subnet change without all four immediately modifying production. and Workstream C: A module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance. Select exactly 3 actions, one addressing each distinct workstream.
- Re-run terraform init and review module/provider resolution within existing constraints.
- Keep one authoritative managed address per remote object and refactor references accordingly.
- Run terraform validate after successful initialization to check syntax and internal configuration consistency.
- Let the state lock serialize operations and retry after the active writer finishes.
- Review the HCL change through version control and inspect a Terraform execution plan before authorized apply.
- Index the resource collection by its actual for_each key rather than assuming numeric list positions.
Explanation
Correct Answers
D:For the workstream in which two release pipelines try to update the same remote state simultaneously and one sees a lock-acquisition failure, use this action: Let the state lock serialize operations and retry after the active writer finishes. State locking prevents concurrent writers from independently changing a shared snapshot. Verify: Only one run modifies the protected state at a time and the second safely waits or fails. Limitation: Locking support depends on backend type; disabling locks invites state corruption.
E:For the workstream in which an operations group wants four engineers to propose a subnet change without all four immediately modifying production, use this action: Review the HCL change through version control and inspect a Terraform execution plan before authorized apply. The plan allows collaboration and review of proposed real-resource actions, which code diffs alone do not reveal. Verify: A pull request includes configuration differences and a plan describing expected resource mutations. Limitation: A plan is a snapshot of observed state and can become stale before apply.
F:For the workstream in which a module uses for_each on a map of regions and must output one subnet ID for the us-east-1 instance, use this action: Index the resource collection by its actual for_each key rather than assuming numeric list positions. for_each resources are addressed using keys, whereas count resources use numeric indices. Verify: The evaluated expression points to the correct keyed instance address in the plan. Limitation: Keys must exist and be stable; renaming a key may change addresses and induce replacement.
Incorrect Answers
A:This action is appropriate instead for a different, unlisted requirement: A CI job already has provider plugins cached and wants to reinitialize a checkout safely after an ordinary module change. It would be checked by: Initialization completes without destroying infrastructure and updates required module installations. None of the 3 specified workstreams calls for this action; their correct choices directly solve the identified cases.
B:This action is appropriate instead for a different, unlisted requirement: An engineer is importing one cloud instance but attempts to assign the same remote object to two Terraform resource addresses. It would be checked by: State inspection shows the imported instance at a single intended address. 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 developer adds a missing required argument to a resource definition and needs a fast validation before planning. It would be checked by: The validate command reports whether the configuration passes Terraform's static checks. 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