Practice Exams:

HashiCorp Terraform Associate 004 Dumps

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

Terraform Associate 004 Premium Bundle


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

HashiCorp Terraform Associate 004 Practice Test 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?

  1. Implement: Use a compatible provider with documented resource schemas to translate Terraform configuration into authorized API operations for the target service. Verify: Inspect terraform providers and provider documentation, plan a test resource, and verify the appropriate remote API object is queried under the configured account.
  2. Implement: Configure required provider aliases in a child module's configuration_aliases when necessary and pass explicit provider mappings from the calling module. Verify: Plan two disposable resources with distinct provider aliases and verify the expected region and account are recorded for each object.
  3. Implement: Configure required provider aliases in a child module's configuration_aliases when necessary and pass explicit provider mappings from the calling module. Verify: Run terraform validate and a sandbox plan with a module using two aliases and inspect which account each module-managed resource targets.
  4. Implement: Declare separate provider blocks with an alias and use the resource provider meta-argument to bind individual resources to the intended region or account. Verify: Run terraform validate and a sandbox plan with a module using two aliases and inspect which account each module-managed resource targets.

Answer & Explanations

Correct answer: C

A.

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.

B.

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.

C.

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.

D.

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?

  1. Authenticate provider plugins using approved workload identity or environment credential mechanisms and grant only the required service permissions.
  2. Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform.
  3. Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
  4. Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

Answer & Explanations

Correct answer: C

A.

Authenticate provider plugins using approved workload identity or environment credential mechanisms and grant only the required service permissions. This addresses “Keep provider credentials out of committed HCL code”, where the governing principle is: Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state. The stated case instead calls for: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.

B.

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.

C.

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.

D.

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?

  1. Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state.
  2. State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
  3. Constraints define allowed versions while the dependency lock file captures selected checksums and selections for repeatable installs across team machines.
  4. Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state.

Answer & Explanations

Correct answer: B

A.

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.

B.

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.

C.

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.

D.

Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state. That explains “Keep provider credentials out of committed HCL code”, not the mechanism behind the described change. The relevant principle is: 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?

  1. Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.
  2. Run an isolated plan under a restricted CI identity, confirm approved reads succeed and a protected out-of-scope API call is denied.
  3. Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.
  4. Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.

Answer & Explanations

Correct answer: D

A.

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.

B.

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.

C.

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.

D.

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?

  1. Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported.
  2. Delete the dependency lock file on every CI run and accept whichever newest provider happens to be published that day.
  3. Commit a production state file to a public repository because variable values are marked sensitive in HCL.
  4. Commit a project-owner token as a literal provider argument so every developer and fork of the repository can run terraform apply.

Answer & Explanations

Correct answer: A

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.

B.

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.

C.

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.

D.

Commit a project-owner token as a literal provider argument so every developer and fork of the repository can run terraform apply. That shortcut risks persistent cloud credential exposure through version history and CI artifacts. Here the specific shortcut is: Delete 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?

  1. Implement: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. Verify: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
  2. Implement: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. Verify: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.
  3. Implement: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. Verify: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
  4. Implement: Specify provider source and compatible version constraints in required_providers, commit .terraform.lock.hcl, and run terraform init with the expected platform. Verify: Initialize two clean working directories from the same commit and inspect terraform providers and the lock file for the expected provider source and version.

Answer & Explanations

Correct answer: A

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.

B.

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.

C.

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.

D.

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?

  1. Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.
  2. Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
  3. Use a compatible provider with documented resource schemas to translate Terraform configuration into authorized API operations for the target service.
  4. Authenticate provider plugins using approved workload identity or environment credential mechanisms and grant only the required service permissions.

Answer & Explanations

Correct answer: B

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. 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.

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. 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.

C.

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.

D.

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?

  1. Terraform Core computes dependencies and manages plans while provider plugins implement resource read, create, update and delete behavior for remote APIs.
  2. Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state.
  3. State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
  4. Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state.

Answer & Explanations

Correct answer: C

A.

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.

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. 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.

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. 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.

D.

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?

  1. Inspect terraform providers and provider documentation, plan a test resource, and verify the appropriate remote API object is queried under the configured account.
  2. Run an isolated plan under a restricted CI identity, confirm approved reads succeed and a protected out-of-scope API call is denied.
  3. Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.
  4. Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.

Answer & Explanations

Correct answer: D

A.

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.

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. 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.

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. 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.

D.

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?

  1. Commit a project-owner token as a literal provider argument so every developer and fork of the repository can run terraform apply.
  2. Commit a production state file to a public repository because variable values are marked sensitive in HCL.
  3. Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported.
  4. Assume Terraform Core itself knows every third-party API argument and can create arbitrary resources without a provider plugin.

Answer & Explanations

Correct answer: C

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. 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.

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. 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.

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. 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.

D.

Assume Terraform Core itself knows every third-party API argument and can create arbitrary resources without a provider plugin. That shortcut risks unknown resource type errors or unintended infrastructure assumptions from missing provider schemas. Here the specific shortcut is: Delete 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?

  1. Implement: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. Verify: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
  2. Implement: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. Verify: Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result.
  3. Implement: Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. Verify: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.
  4. Implement: Authenticate provider plugins using approved workload identity or environment credential mechanisms and grant only the required service permissions. Verify: Run an isolated plan under a restricted CI identity, confirm approved reads succeed and a protected out-of-scope API call is denied.

Answer & Explanations

Correct answer: A

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.

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. 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.

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. 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.

D.

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