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 14

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.

Question 131

A healthcare platform stores database credentials in Terraform-managed resources and needs a secure state backend with restricted access. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
  2. Declare separate provider blocks with an alias and use the resource provider meta-argument to bind individual resources to the intended region or account.
  3. Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion.
  4. Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

Answer & Explanations

Correct answer: D

A.

Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. This addresses “Treat Terraform state as a resource-instance binding record”, where the governing principle is: State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure. The stated case instead calls for: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

B.

Declare separate provider blocks with an alias and use the resource provider meta-argument to bind individual resources to the intended region or account. This addresses “Select aliased provider configurations for a second region”, where the governing principle is: Terraform selects the default provider unless an explicit alias is passed; each aliased instance carries its own endpoints and credential context. The stated case instead calls for: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

C.

Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion. This addresses “Upgrade a selected provider deliberately using terraform init -upgrade”, where the governing principle is: The upgrade option allows choosing newer provider versions that satisfy configured constraints; a normal locked initialization typically reuses existing selections. The stated case instead calls for: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

D.

Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state. Verify the result with this test: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.

Question 132

A healthcare platform stores database credentials in Terraform-managed resources and needs a secure state backend with restricted access. The infrastructure engineer proposes this change: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. Which mechanism explains why it works?

  1. Terraform selects the default provider unless an explicit alias is passed; each aliased instance carries its own endpoints and credential context.
  2. Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state.
  3. State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
  4. The upgrade option allows choosing newer provider versions that satisfy configured constraints; a normal locked initialization typically reuses existing selections.

Answer & Explanations

Correct answer: B

A.

Terraform selects the default provider unless an explicit alias is passed; each aliased instance carries its own endpoints and credential context. That explains “Select aliased provider configurations for a second region”, not the mechanism behind the described change. The relevant 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.

B.

Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state. The corresponding implementation is: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

C.

State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure. That explains “Treat Terraform state as a resource-instance binding record”, not the mechanism behind the described change. The relevant 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.

D.

The upgrade option allows choosing newer provider versions that satisfy configured constraints; a normal locked initialization typically reuses existing selections. That explains “Upgrade a selected provider deliberately using terraform init -upgrade”, not the mechanism behind the described change. The relevant 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.

Question 133

A healthcare platform stores database credentials in Terraform-managed resources and needs a secure state backend with restricted access. After implementing this change—Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.—which test most directly validates its intended outcome?

  1. Compare .terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures.
  2. 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. Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.
  4. Plan two disposable resources with distinct provider aliases and verify the expected region and account are recorded for each object.

Answer & Explanations

Correct answer: C

A.

Compare.terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures. That would help test “Upgrade a selected provider deliberately using terraform init -upgrade”, not the outcome required in this scenario. The relevant acceptance check is: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.

B.

Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result. That would help test “Treat Terraform state as a resource-instance binding record”, not the outcome required in this scenario. The relevant acceptance check is: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.

C.

Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots. This check is decisive because resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state.

D.

Plan two disposable resources with distinct provider aliases and verify the expected region and account are recorded for each object. That would help test “Select aliased provider configurations for a second region”, not the outcome required in this scenario. The relevant acceptance check is: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.

Question 134

A healthcare platform stores database credentials in Terraform-managed resources and needs a secure state backend with restricted access. Which proposed shortcut most directly risks credential or private infrastructure data exposure from uncontrolled state storage and should therefore be rejected?

  1. Commit a production state file to a public repository because variable values are marked sensitive in HCL.
  2. Change a version constraint in production and apply immediately without inspecting the selected provider binary or resulting plan changes.
  3. Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported.
  4. Declare a second provider alias but forget to associate the regional resource with it, assuming Terraform selects the nearest geographic region.

Answer & Explanations

Correct answer: A

A.

Commit a production state file to a public repository because variable values are marked sensitive in HCL. The foreseeable failure is credential or private infrastructure data exposure from uncontrolled state storage. The safer response is: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

B.

Change a version constraint in production and apply immediately without inspecting the selected provider binary or resulting plan changes. That shortcut risks unexpected destructive changes from unreviewed provider dependency upgrades. Here the specific shortcut is: Commit a production state file to a public repository because variable values are marked sensitive in HCL.

C.

Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported. That shortcut risks orphaned infrastructure or duplicate creation attempts after state bindings disappear. Here the specific shortcut is: Commit a production state file to a public repository because variable values are marked sensitive in HCL.

D.

Declare a second provider alias but forget to associate the regional resource with it, assuming Terraform selects the nearest geographic region. That shortcut risks creation of infrastructure in the wrong region or account. Here the specific shortcut is: Commit a production state file to a public repository because variable values are marked sensitive in HCL.

Question 135

A healthcare platform stores database credentials in Terraform-managed resources and needs a secure state backend with restricted access. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion. Verify: Compare .terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures.
  2. Implement: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. Verify: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.
  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: 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.

Answer & Explanations

Correct answer: B

A.

This action/test pair addresses “Upgrade a selected provider deliberately using terraform init -upgrade”. Review provider version constraints, run terraform init -upgrade in an isolated branch, inspect the lock-file diff and re-run validation and plans before promotion. Compare.terraform.lock.hcl before and after a controlled upgrade in staging and ensure the plan has no unintended replacements or schema failures. The case instead calls for: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

B.

Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. Confirm it through this test: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots. Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state.

C.

The test would be relevant: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots. But the offered implementation—Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.—addresses “Treat Terraform state as a resource-instance binding record”. The action needed here is: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

D.

The action is applicable: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. But its proposed 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.—addresses “Treat Terraform state as a resource-instance binding record”. This requirement is confirmed instead by: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.

Question 136

A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. 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. Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.
  3. Declare separate provider blocks with an alias and use the resource provider meta-argument to bind individual resources to the intended region or account.
  4. Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

Answer & Explanations

Correct answer: D

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: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

B.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations. This addresses “Treat Terraform state as a resource-instance binding record”, where the governing principle is: State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure. The stated case instead calls for: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

C.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Declare separate provider blocks with an alias and use the resource provider meta-argument to bind individual resources to the intended region or account. This addresses “Select aliased provider configurations for a second region”, where the governing principle is: Terraform selects the default provider unless an explicit alias is passed; each aliased instance carries its own endpoints and credential context. The stated case instead calls for: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

D.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state. Verify the result with this test: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.

Question 137

A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. The infrastructure engineer proposes this change: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. Which mechanism explains why it works?

  1. Provider configuration selects API endpoints and authentication; putting long-lived secrets in source creates distribution and rotation risks beyond Terraform state.
  2. State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure.
  3. Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state.
  4. Terraform selects the default provider unless an explicit alias is passed; each aliased instance carries its own endpoints and credential context.

Answer & Explanations

Correct answer: C

A.

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: Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state.

B.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. State records identities and relevant resource attributes so Terraform can detect changes; deleting it does not automatically delete the remote infrastructure. That explains “Treat Terraform state as a resource-instance binding record”, not the mechanism behind the described change. The relevant 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.

C.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state. The corresponding implementation is: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

D.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Terraform selects the default provider unless an explicit alias is passed; each aliased instance carries its own endpoints and credential context. That explains “Select aliased provider configurations for a second region”, not the mechanism behind the described change. The relevant 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.

Question 138

A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. After implementing this change—Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.—which test most directly validates its intended outcome?

  1. Run an isolated plan under a restricted CI identity, confirm approved reads succeed and a protected out-of-scope API call is denied.
  2. Plan two disposable resources with distinct provider aliases and verify the expected region and account are recorded for each object.
  3. 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. Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.

Answer & Explanations

Correct answer: D

A.

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: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.

B.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Plan two disposable resources with distinct provider aliases and verify the expected region and account are recorded for each object. That would help test “Select aliased provider configurations for a second region”, not the outcome required in this scenario. The relevant acceptance check is: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.

C.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Apply a disposable resource, inspect its state address and remote ID, then plan again without modifying state manually to confirm a no-change result. That would help test “Treat Terraform state as a resource-instance binding record”, not the outcome required in this scenario. The relevant acceptance check is: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.

D.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots. This check is decisive because resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state.

Question 139

A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Which proposed shortcut most directly risks credential or private infrastructure data exposure from uncontrolled state storage and should therefore be rejected?

  1. Commit a production state file to a public repository because variable values are marked sensitive in HCL.
  2. Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported.
  3. Declare a second provider alias but forget to associate the regional resource with it, assuming Terraform selects the nearest geographic region.
  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.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Commit a production state file to a public repository because variable values are marked sensitive in HCL. The foreseeable failure is credential or private infrastructure data exposure from uncontrolled state storage. The safer response is: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

B.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Delete terraform.tfstate to hide a drift warning and assume the cloud objects will automatically be destroyed or safely re-imported. That shortcut risks orphaned infrastructure or duplicate creation attempts after state bindings disappear. Here the specific shortcut is: Commit a production state file to a public repository because variable values are marked sensitive in HCL.

C.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Declare a second provider alias but forget to associate the regional resource with it, assuming Terraform selects the nearest geographic region. That shortcut risks creation of infrastructure in the wrong region or account. Here the specific shortcut is: Commit a production state file to a public repository because variable values are marked sensitive in HCL.

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: Commit a production state file to a public repository because variable values are marked sensitive in HCL.

Question 140

A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Which combined implementation and verification plan is the best match for this workload?

  1. 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.
  2. Implement: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. Verify: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.
  3. 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: Plan two disposable resources with distinct provider aliases and verify the expected region and account are recorded for each object.
  4. 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.

Answer & Explanations

Correct answer: B

A.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. The action is applicable: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. But its proposed 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.—addresses “Treat Terraform state as a resource-instance binding record”. This requirement is confirmed instead by: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots.

B.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration. Confirm it through this test: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots. Resource state may store secrets or other sensitive provider attributes; marking a value sensitive normally masks display rather than removing it from state.

C.

This action/test pair addresses “Select aliased provider configurations for a second region”. Declare separate provider blocks with an alias and use the resource provider meta-argument to bind individual resources to the intended region or account. Plan two disposable resources with distinct provider aliases and verify the expected region and account are recorded for each object. The case instead calls for: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

D.

The question is set in this situation: A startup uses sensitive variables and mistakenly believes this means its exported terraform.tfstate can be safely distributed to contractors. The test would be relevant: Create a nonsecret test state, inspect access controls, and verify that unauthorized readers cannot download or list state snapshots. But the offered implementation—Store state securely and let Terraform maintain the mapping between resource addresses and remote identifiers during reviewed apply operations.—addresses “Treat Terraform state as a resource-instance binding record”. The action needed here is: Protect state snapshots, restrict backend access and enable appropriate encryption even when variables are marked sensitive in configuration.

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