HashiCorp Terraform Associate 004 Dumps
HashiCorp Terraform Associate 004 Practice Test 60
Question 590
A retailer wants to update state after a provider detects a harmless externally assigned attribute but not silently override declared settings. Which combined implementation and verification plan is the best match for this workload?
Answer & Explanations
Correct answer: A
The question is set in this situation: A retailer wants to update state after a provider detects a harmless externally assigned attribute but not silently override declared settings. Run terraform plan -refresh-only to inspect externally changed resource attributes and review a refresh-only apply only when state should accept the remote reality. Confirm it through this test: Change a safe remote tag on a disposable resource, compare normal and refresh-only plans and verify their effects differ before approving either. Refresh-only mode updates Terraform's observed state and outputs without reconciling remote objects toward configuration; normal plans may instead propose repairs.
The question is set in this situation: A retailer wants to update state after a provider detects a harmless externally assigned attribute but not silently override declared settings. The test would be relevant: Change a safe remote tag on a disposable resource, compare normal and refresh-only plans and verify their effects differ before approving either. But the offered implementation—Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.—addresses “Use moved blocks for resource address refactors without intentional recreation”. The action needed here is: Run terraform plan -refresh-only to inspect externally changed resource attributes and review a refresh-only apply only when state should accept the remote reality.
This action/test pair addresses “Do not assume local backend state is automatically backed up”. Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses. The case instead calls for: Run terraform plan -refresh-only to inspect externally changed resource attributes and review a refresh-only apply only when state should accept the remote reality.
The question is set in this situation: A retailer wants to update state after a provider detects a harmless externally assigned attribute but not silently override declared settings. The action is applicable: Run terraform plan -refresh-only to inspect externally changed resource attributes and review a refresh-only apply only when state should accept the remote reality. But its proposed test—Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.—addresses “Use moved blocks for resource address refactors without intentional recreation”. This requirement is confirmed instead by: Change a safe remote tag on a disposable resource, compare normal and refresh-only plans and verify their effects differ before approving either.
Question 591
A bank moves a test subnet declaration into a child module and wants the existing subnet ID preserved during the refactor. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?
Answer & Explanations
Correct answer: C
Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. This addresses “Configure a supported remote state backend with access controls”, where the governing principle is: A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access. The stated case instead calls for: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. This addresses “Keep backend configuration credentials outside source control”, where the governing principle is: Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata. The stated case instead calls for: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity. Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource. Verify the result with this test: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.
Run terraform plan -refresh-only to inspect externally changed resource attributes and review a refresh-only apply only when state should accept the remote reality. This addresses “Use refresh-only plans to reconcile observed drift into state deliberately”, where the governing principle is: Refresh-only mode updates Terraform's observed state and outputs without reconciling remote objects toward configuration; normal plans may instead propose repairs. The stated case instead calls for: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
Question 592
A bank moves a test subnet declaration into a child module and wants the existing subnet ID preserved during the refactor. The infrastructure engineer proposes this change: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity. Which mechanism explains why it works?
Answer & Explanations
Correct answer: B
Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata. That explains “Keep backend configuration credentials outside source control”, not the mechanism behind the described change. The relevant principle is: Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource.
Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource. The corresponding implementation is: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access. That explains “Configure a supported remote state backend with access controls”, not the mechanism behind the described change. The relevant principle is: Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource.
Refresh-only mode updates Terraform's observed state and outputs without reconciling remote objects toward configuration; normal plans may instead propose repairs. That explains “Use refresh-only plans to reconcile observed drift into state deliberately”, not the mechanism behind the described change. The relevant principle is: Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource.
Question 593
A bank moves a test subnet declaration into a child module and wants the existing subnet ID preserved during the refactor. After implementing this change—Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.—which test most directly validates its intended outcome?
Answer & Explanations
Correct answer: D
Initialize a disposable remote backend, apply a test resource and verify the resulting state is in the intended restricted location rather than the local directory. That would help test “Configure a supported remote state backend with access controls”, not the outcome required in this scenario. The relevant acceptance check is: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.
Change a safe remote tag on a disposable resource, compare normal and refresh-only plans and verify their effects differ before approving either. That would help test “Use refresh-only plans to reconcile observed drift into state deliberately”, not the outcome required in this scenario. The relevant acceptance check is: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.
Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password. That would help test “Keep backend configuration credentials outside source control”, not the outcome required in this scenario. The relevant acceptance check is: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.
Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID. This check is decisive because moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource.
Question 594
A bank moves a test subnet declaration into a child module and wants the existing subnet ID preserved during the refactor. Which proposed shortcut most directly risks unintended destroy-and-create operations during harmless code organization and should therefore be rejected?
Answer & Explanations
Correct answer: A
Rename a resource block in production without a moved mapping and assume Terraform always recognizes it as the same object by cloud display name. The foreseeable failure is unintended destroy-and-create operations during harmless code organization. The safer response is: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage. That shortcut risks multiple authoritative state copies or loss of tracking after backend changes. Here the specific shortcut is: Rename a resource block in production without a moved mapping and assume Terraform always recognizes it as the same object by cloud display name.
Assume terraform apply -refresh-only will forcibly restore every cloud resource to its old configured values after an external manual edit. That shortcut risks unrepaired infrastructure drift because state refresh was confused with configuration enforcement. Here the specific shortcut is: Rename a resource block in production without a moved mapping and assume Terraform always recognizes it as the same object by cloud display name.
Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository. That shortcut risks unauthorized access to state snapshots and secrets due to leaked backend credentials. Here the specific shortcut is: Rename a resource block in production without a moved mapping and assume Terraform always recognizes it as the same object by cloud display name.
Question 595
A bank moves a test subnet declaration into a child module and wants the existing subnet ID preserved during the refactor. Which combined implementation and verification plan is the best match for this workload?
Answer & Explanations
Correct answer: C
This action/test pair addresses “Keep backend configuration credentials outside source control”. Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password. The case instead calls for: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
The test would be relevant: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID. But the offered implementation—Run terraform plan -refresh-only to inspect externally changed resource attributes and review a refresh-only apply only when state should accept the remote reality.—addresses “Use refresh-only plans to reconcile observed drift into state deliberately”. The action needed here is: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity. Confirm it through this test: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID. Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource.
The action is applicable: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity. But its proposed test—Change a safe remote tag on a disposable resource, compare normal and refresh-only plans and verify their effects differ before approving either.—addresses “Use refresh-only plans to reconcile observed drift into state deliberately”. This requirement is confirmed instead by: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.
Question 596
An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?
Answer & Explanations
Correct answer: B
Configure a remote backend with supported state locking and avoid applying while another run holds the relevant workspace lock. This addresses “Respect state locking when multiple operators share a backend”, where the governing principle is: Locking protects the critical section for reading and writing a shared state snapshot; concurrent plan-and-apply processes can otherwise race. The stated case instead calls for: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity. Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource. Verify the result with this test: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Run terraform plan -refresh-only to inspect externally changed resource attributes and review a refresh-only apply only when state should accept the remote reality. This addresses “Use refresh-only plans to reconcile observed drift into state deliberately”, where the governing principle is: Refresh-only mode updates Terraform's observed state and outputs without reconciling remote objects toward configuration; normal plans may instead propose repairs. The stated case instead calls for: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. This addresses “Keep backend configuration credentials outside source control”, where the governing principle is: Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata. The stated case instead calls for: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
Question 597
An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. The infrastructure engineer proposes this change: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity. Which mechanism explains why it works?
Answer & Explanations
Correct answer: B
Locking protects the critical section for reading and writing a shared state snapshot; concurrent plan-and-apply processes can otherwise race. That explains “Respect state locking when multiple operators share a backend”, not the mechanism behind the described change. The relevant principle is: Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource. The corresponding implementation is: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata. That explains “Keep backend configuration credentials outside source control”, not the mechanism behind the described change. The relevant principle is: Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Refresh-only mode updates Terraform's observed state and outputs without reconciling remote objects toward configuration; normal plans may instead propose repairs. That explains “Use refresh-only plans to reconcile observed drift into state deliberately”, not the mechanism behind the described change. The relevant principle is: Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource.
Question 598
An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. After implementing this change—Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.—which test most directly validates its intended outcome?
Answer & Explanations
Correct answer: D
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password. That would help test “Keep backend configuration credentials outside source control”, not the outcome required in this scenario. The relevant acceptance check is: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.
Launch two harmless test operations against a locking-capable backend and verify the second cannot modify state until the first releases its lock. That would help test “Respect state locking when multiple operators share a backend”, not the outcome required in this scenario. The relevant acceptance check is: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Change a safe remote tag on a disposable resource, compare normal and refresh-only plans and verify their effects differ before approving either. That would help test “Use refresh-only plans to reconcile observed drift into state deliberately”, not the outcome required in this scenario. The relevant acceptance check is: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID. This check is decisive because moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource.
Question 599
An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Which proposed shortcut most directly risks unintended destroy-and-create operations during harmless code organization and should therefore be rejected?
Answer & Explanations
Correct answer: C
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Assume terraform apply -refresh-only will forcibly restore every cloud resource to its old configured values after an external manual edit. That shortcut risks unrepaired infrastructure drift because state refresh was confused with configuration enforcement. Here the specific shortcut is: Rename a resource block in production without a moved mapping and assume Terraform always recognizes it as the same object by cloud display name.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository. That shortcut risks unauthorized access to state snapshots and secrets due to leaked backend credentials. Here the specific shortcut is: Rename a resource block in production without a moved mapping and assume Terraform always recognizes it as the same object by cloud display name.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Rename a resource block in production without a moved mapping and assume Terraform always recognizes it as the same object by cloud display name. The foreseeable failure is unintended destroy-and-create operations during harmless code organization. The safer response is: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
Disable locking for a busy shared state so both pipelines can apply competing changes at the same time. That shortcut risks corrupted state or infrastructure conflicts from concurrent writes. Here the specific shortcut is: Rename a resource block in production without a moved mapping and assume Terraform always recognizes it as the same object by cloud display name.
Question 600
An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Which combined implementation and verification plan is the best match for this workload?
Answer & Explanations
Correct answer: A
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity. Confirm it through this test: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID. Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource.
This action/test pair addresses “Respect state locking when multiple operators share a backend”. Configure a remote backend with supported state locking and avoid applying while another run holds the relevant workspace lock. Launch two harmless test operations against a locking-capable backend and verify the second cannot modify state until the first releases its lock. The case instead calls for: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. The action is applicable: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity. But its proposed test—Change a safe remote tag on a disposable resource, compare normal and refresh-only plans and verify their effects differ before approving either.—addresses “Use refresh-only plans to reconcile observed drift into state deliberately”. This requirement is confirmed instead by: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.
The question is set in this situation: An education startup renames network resource labels for clarity but cannot accept replacement of its shared staging infrastructure. The test would be relevant: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID. But the offered implementation—Run terraform plan -refresh-only to inspect externally changed resource attributes and review a refresh-only apply only when state should accept the remote reality.—addresses “Use refresh-only plans to reconcile observed drift into state deliberately”. The action needed here is: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests
- HashiCorp Terraform Associate 004 Practice Test 58 - 10 Questions (Last Reviewed 28-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 59 - 10 Questions (Last Reviewed 27-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 60 - 10 Questions (Last Reviewed 26-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 61 - 10 Questions (Last Reviewed 25-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 62 - 10 Questions (Last Reviewed 24-Nov-2026)