HashiCorp Terraform Associate 004 Dumps
HashiCorp Terraform Associate 004 Practice Test 13
Question 120
A research institute calls a shared module that creates resources in two approved regions and must avoid default-provider leakage. Which combined implementation and verification plan is the best match for this workload?
Answer & Explanations
Correct answer: C
This action/test pair addresses “Understand provider plugins as the bridge to service APIs”. Use a compatible provider with documented resource schemas to translate Terraform configuration into authorized API operations for the target service. Inspect terraform providers and provider documentation, plan a test resource, and verify the appropriate remote API object is queried under the configured account. The case instead calls for: Configure required provider aliases in a child module's configuration_aliases when necessary and pass explicit provider mappings from the calling module.
The question is set in this situation: A research institute calls a shared module that creates resources in two approved regions and must avoid default-provider leakage. The action is applicable: Configure required provider aliases in a child module's configuration_aliases when necessary and pass explicit provider mappings from the calling module. But its proposed test—Plan two disposable resources with distinct provider aliases and verify the expected region and account are recorded for each object.—addresses “Select aliased provider configurations for a second region”. This requirement is confirmed instead by: Run terraform validate and a sandbox plan with a module using two aliases and inspect which account each module-managed resource targets.
The question is set in this situation: A research institute calls a shared module that creates resources in two approved regions and must avoid default-provider leakage. Configure required provider aliases in a child module's configuration_aliases when necessary and pass explicit provider mappings from the calling module. Confirm it through this test: Run terraform validate and a sandbox plan with a module using two aliases and inspect which account each module-managed resource targets. Modules can inherit default providers but nondefault configurations must be passed deliberately; otherwise resources may resolve to an unintended default or lack configuration.
The question is set in this situation: A research institute calls a shared module that creates resources in two approved regions and must avoid default-provider leakage. The test would be relevant: Run terraform validate and a sandbox plan with a module using two aliases and inspect which account each module-managed resource targets. But the offered implementation—Declare separate provider blocks with an alias and use the resource provider meta-argument to bind individual resources to the intended region or account.—addresses “Select aliased provider configurations for a second region”. The action needed here is: Configure required provider aliases in a child module's configuration_aliases when necessary and pass explicit provider mappings from the calling module.
Question 121
A company has cloud instances running after an engineer deleted its local state file and now Terraform proposes additional instances. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?
Answer & Explanations
Correct answer: C
Authenticate provider plugins using approved workload identity or environment credential mechanisms and grant only the required service permissions. This addresses “Keep provider credentials out of committed HCL code”, where the governing principle is: Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state. The stated case instead calls for: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform. This addresses “Use explicit provider version constraints and lock files”, where the governing principle is: Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines. The stated case instead calls for: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure. Verify the result with this test: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. This addresses “Understand that Terraform state can contain sensitive resource values”, where the governing principle is: Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state. The stated case instead calls for: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
Question 122
A company has cloud instances running after an engineer deleted its local state file and now Terraform proposes additional instances. The infrastructure engineer proposes this change: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. Which mechanism explains why it works?
Answer & Explanations
Correct answer: B
Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state. That explains “Understand that Terraform state can contain sensitive resource values”, not the mechanism behind the described change. The relevant principle is: State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure. The corresponding implementation is: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines. That explains “Use explicit provider version constraints and lock files”, not the mechanism behind the described change. The relevant principle is: State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state. That explains “Keep provider credentials out of committed HCL code”, not the mechanism behind the described change. The relevant principle is: State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
Question 123
A company has cloud instances running after an engineer deleted its local state file and now Terraform proposes additional instances. After implementing this change—Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.—which test most directly validates its intended outcome?
Answer & Explanations
Correct answer: D
Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots. That would help test “Understand that Terraform state can contain sensitive resource values”, not the outcome required in this scenario. The relevant acceptance check is: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
Run an isolated plan under a restricted CI identity, confirm approved reads succeed and a protected out-of-scope API call is denied. That would help test “Keep provider credentials out of committed HCL code”, not the outcome required in this scenario. The relevant acceptance check is: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version. That would help test “Use explicit provider version constraints and lock files”, not the outcome required in this scenario. The relevant acceptance check is: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result. This check is decisive because state records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
Question 124
A company has cloud instances running after an engineer deleted its local state file and now Terraform proposes additional instances. Which proposed shortcut most directly risks orphaned infrastructure or duplicate creation attempts after state bindings disappear and should therefore be rejected?
Answer & Explanations
Correct answer: A
Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported. The foreseeable failure is orphaned infrastructure or duplicate creation attempts after state bindings disappear. The safer response is: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day. That shortcut risks nonreproducible plans or breaking provider upgrades between runs. Here the specific shortcut is: Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported.
Commit a production state file to a public repository because variable values are marked sensitive in HCL. That shortcut risks credential or private infrastructure data exposure from uncontrolled state storage. Here the specific shortcut is: Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported.
Commit a project-owner token as a literal provider argument so every developer and fork of the repository can run terraform apply. That shortcut risks persistent cloud credential exposure through version history and CI artifacts. Here the specific shortcut is: Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported.
Question 125
A company has cloud instances running after an engineer deleted its local state file and now Terraform proposes additional instances. Which combined implementation and verification plan is the best match for this workload?
Answer & Explanations
Correct answer: A
Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. Confirm it through this test: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result. State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
The action is applicable: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. But its proposed test—Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.—addresses “Understand that Terraform state can contain sensitive resource values”. This requirement is confirmed instead by: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
The test would be relevant: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result. But the offered implementation—Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.—addresses “Understand that Terraform state can contain sensitive resource values”. The action needed here is: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
This action/test pair addresses “Use explicit provider version constraints and lock files”. Specify provider source and compatible version constraints in required_providers, commit.terraform.lock.hcl, and run terraform init with the expected platform. Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version. The case instead calls for: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
Question 126
A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?
Answer & Explanations
Correct answer: B
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. This addresses “Understand that Terraform state can contain sensitive resource values”, where the governing principle is: Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state. The stated case instead calls for: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure. Verify the result with this test: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
Use a compatible provider with documented resource schemas to translate Terraform configuration into authorized API operations for the target service. This addresses “Understand provider plugins as the bridge to service APIs”, where the governing principle is: Terraform Core computes dependencies and manages plans while provider plugins implement resource read, create, update and delete behavior for remote APIs. The stated case instead calls for: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Authenticate provider plugins using approved workload identity or environment credential mechanisms and grant only the required service permissions. This addresses “Keep provider credentials out of committed HCL code”, where the governing principle is: Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state. The stated case instead calls for: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
Question 127
A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. The infrastructure engineer proposes this change: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. Which mechanism explains why it works?
Answer & Explanations
Correct answer: C
Terraform Core computes dependencies and manages plans while provider plugins implement resource read, create, update and delete behavior for remote APIs. That explains “Understand provider plugins as the bridge to service APIs”, not the mechanism behind the described change. The relevant principle is: State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state. That explains “Keep provider credentials out of committed HCL code”, not the mechanism behind the described change. The relevant principle is: State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure. The corresponding implementation is: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state. That explains “Understand that Terraform state can contain sensitive resource values”, not the mechanism behind the described change. The relevant principle is: State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
Question 128
A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. After implementing this change—Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.—which test most directly validates its intended outcome?
Answer & Explanations
Correct answer: D
Inspect terraform providers and provider documentation, plan a test resource, and verify the appropriate remote API object is queried under the configured account. That would help test “Understand provider plugins as the bridge to service APIs”, not the outcome required in this scenario. The relevant acceptance check is: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Run an isolated plan under a restricted CI identity, confirm approved reads succeed and a protected out-of-scope API call is denied. That would help test “Keep provider credentials out of committed HCL code”, not the outcome required in this scenario. The relevant acceptance check is: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots. That would help test “Understand that Terraform state can contain sensitive resource values”, not the outcome required in this scenario. The relevant acceptance check is: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result. This check is decisive because state records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
Question 129
A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Which proposed shortcut most directly risks orphaned infrastructure or duplicate creation attempts after state bindings disappear and should therefore be rejected?
Answer & Explanations
Correct answer: C
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Commit a project-owner token as a literal provider argument so every developer and fork of the repository can run terraform apply. That shortcut risks persistent cloud credential exposure through version history and CI artifacts. Here the specific shortcut is: Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Commit a production state file to a public repository because variable values are marked sensitive in HCL. That shortcut risks credential or private infrastructure data exposure from uncontrolled state storage. Here the specific shortcut is: Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported. The foreseeable failure is orphaned infrastructure or duplicate creation attempts after state bindings disappear. The safer response is: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
Assume Terraform Core itself knows every third-party API argument and can create arbitrary resources without a provider plugin. That shortcut risks unknown resource type errors or unintended infrastructure assumptions from missing provider schemas. Here the specific shortcut is: Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported.
Question 130
A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. 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 laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. Confirm it through this test: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result. State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. The test would be relevant: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result. But the offered implementation—Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.—addresses “Understand that Terraform state can contain sensitive resource values”. The action needed here is: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
The question is set in this situation: A laboratory migrates an environment to a new repository and needs to preserve identity mappings for existing virtual machines. The action is applicable: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. But its proposed test—Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.—addresses “Understand that Terraform state can contain sensitive resource values”. This requirement is confirmed instead by: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
This action/test pair addresses “Keep provider credentials out of committed HCL code”. Authenticate provider plugins using approved workload identity or environment credential mechanisms and grant only the required service permissions. Run an isolated plan under a restricted CI identity, confirm approved reads succeed and a protected out-of-scope API call is denied. The case instead calls for: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests
- HashiCorp Terraform Associate 004 Practice Test 11 - 10 Questions (Last Reviewed 18-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 12 - 10 Questions (Last Reviewed 17-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 13 - 10 Questions (Last Reviewed 16-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 14 - 10 Questions (Last Reviewed 15-Nov-2026)
- HashiCorp Terraform Associate 004 Practice Test 15 - 10 Questions (Last Reviewed 14-Nov-2026)