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 62

Question 610

A logistics company adopts a currently running network security group and needs to preserve its physical identity during the transition. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Set TF_LOG and TF_LOG_PATH for a short diagnostic run, protect the output file and scrub any credentials before sharing excerpts externally. Verify: Generate an isolated debug trace, verify the file path is correct and apply a redaction check before archiving only the required error evidence.
  2. Implement: Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier. Verify: Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications.
  3. Implement: Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier. Verify: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.
  4. Implement: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. Verify: Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications.

Answer & Explanations

Correct answer: B

A.

This action/test pair addresses “Use TF_LOG_PATH to capture a targeted troubleshooting trace securely”. Set TF_LOG and TF_LOG_PATH for a short diagnostic run, protect the output file and scrub any credentials before sharing excerpts externally. Generate an isolated debug trace, verify the file path is correct and apply a redaction check before archiving only the required error evidence. The case instead calls for: Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier.

B.

The question is set in this situation: A logistics company adopts a currently running network security group and needs to preserve its physical identity during the transition. Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier. Confirm it through this test: Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications. Import associates an existing remote object with Terraform state; it does not automatically guarantee complete configuration, matching all provider attributes or safe ownership.

C.

The question is set in this situation: A logistics company adopts a currently running network security group and needs to preserve its physical identity during the transition. The action is applicable: Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier. But its proposed test—Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.—addresses “Use declarative import blocks as reviewed adoption instructions”. This requirement is confirmed instead by: Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications.

D.

The question is set in this situation: A logistics company adopts a currently running network security group and needs to preserve its physical identity during the transition. The test would be relevant: Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications. But the offered implementation—Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.—addresses “Use declarative import blocks as reviewed adoption instructions”. The action needed here is: Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier.

Question 611

A financial institution wants existing load balancers imported through peer-reviewed infrastructure pull requests with exact object IDs. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Set TF_LOG and TF_LOG_PATH for a short diagnostic run, protect the output file and scrub any credentials before sharing excerpts externally.
  2. Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier.
  3. Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.
  4. Set TF_LOG to an appropriate diagnostic level for a limited troubleshooting run and disable it after collecting a redacted log in a protected location.

Answer & Explanations

Correct answer: C

A.

Set TF_LOG and TF_LOG_PATH for a short diagnostic run, protect the output file and scrub any credentials before sharing excerpts externally. This addresses “Use TF_LOG_PATH to capture a targeted troubleshooting trace securely”, where the governing principle is: A dedicated log path makes troubleshooting artifacts easier to retain locally but does not redact them or guarantee that providers never output secret-bearing context. The stated case instead calls for: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

B.

Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier. This addresses “Import an existing managed object using the Terraform CLI”, where the governing principle is: Import associates an existing remote object with Terraform state; it does not automatically guarantee complete configuration, matching all provider attributes or safe ownership. The stated case instead calls for: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

C.

Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command. Verify the result with this test: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.

D.

Set TF_LOG to an appropriate diagnostic level for a limited troubleshooting run and disable it after collecting a redacted log in a protected location. This addresses “Enable diagnostic Terraform logging only while investigating faults”, where the governing principle is: Terraform emits more detailed internal/provider interactions when debugging is enabled; verbose logs can expose environment information or sensitive values. The stated case instead calls for: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

Question 612

A financial institution wants existing load balancers imported through peer-reviewed infrastructure pull requests with exact object IDs. The infrastructure engineer proposes this change: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. Which mechanism explains why it works?

  1. Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.
  2. A dedicated log path makes troubleshooting artifacts easier to retain locally but does not redact them or guarantee that providers never output secret-bearing context.
  3. Terraform emits more detailed internal/provider interactions when debugging is enabled; verbose logs can expose environment information or sensitive values.
  4. Import associates an existing remote object with Terraform state; it does not automatically guarantee complete configuration, matching all provider attributes or safe ownership.

Answer & Explanations

Correct answer: A

A.

Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command. The corresponding implementation is: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

B.

A dedicated log path makes troubleshooting artifacts easier to retain locally but does not redact them or guarantee that providers never output secret-bearing context. That explains “Use TF_LOG_PATH to capture a targeted troubleshooting trace securely”, not the mechanism behind the described change. The relevant principle is: Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.

C.

Terraform emits more detailed internal/provider interactions when debugging is enabled; verbose logs can expose environment information or sensitive values. That explains “Enable diagnostic Terraform logging only while investigating faults”, not the mechanism behind the described change. The relevant principle is: Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.

D.

Import associates an existing remote object with Terraform state; it does not automatically guarantee complete configuration, matching all provider attributes or safe ownership. That explains “Import an existing managed object using the Terraform CLI”, not the mechanism behind the described change. The relevant principle is: Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.

Question 613

A financial institution wants existing load balancers imported through peer-reviewed infrastructure pull requests with exact object IDs. After implementing this change—Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.—which test most directly validates its intended outcome?

  1. Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.
  2. Reproduce a harmless provider initialization failure with temporary logging, confirm the relevant error is recorded and clear the log level afterward.
  3. Generate an isolated debug trace, verify the file path is correct and apply a redaction check before archiving only the required error evidence.
  4. Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications.

Answer & Explanations

Correct answer: A

A.

Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object. This check is decisive because terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.

B.

Reproduce a harmless provider initialization failure with temporary logging, confirm the relevant error is recorded and clear the log level afterward. That would help test “Enable diagnostic Terraform logging only while investigating faults”, not the outcome required in this scenario. The relevant acceptance check is: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.

C.

Generate an isolated debug trace, verify the file path is correct and apply a redaction check before archiving only the required error evidence. That would help test “Use TF_LOG_PATH to capture a targeted troubleshooting trace securely”, not the outcome required in this scenario. The relevant acceptance check is: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.

D.

Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications. That would help test “Import an existing managed object using the Terraform CLI”, not the outcome required in this scenario. The relevant acceptance check is: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.

Question 614

A financial institution wants existing load balancers imported through peer-reviewed infrastructure pull requests with exact object IDs. Which proposed shortcut most directly risks unsafe resource adoption or unexpected changes due to missing configuration and should therefore be rejected?

  1. Point TF_LOG_PATH to a world-readable static web directory and leave trace-level logging enabled for all production applies.
  2. Run Terraform TRACE logging permanently in public CI logs and assume debug output can never include sensitive configuration or API details.
  3. Run terraform apply against a newly declared resource that already exists and assume Terraform automatically claims it without import.
  4. Assume placing an import block alone creates a complete and correct Terraform resource configuration for every provider argument automatically.

Answer & Explanations

Correct answer: D

A.

Point TF_LOG_PATH to a world-readable static web directory and leave trace-level logging enabled for all production applies. That shortcut risks sensitive endpoint and credential metadata leaking from diagnostic artifacts. Here the specific shortcut is: Assume placing an import block alone creates a complete and correct Terraform resource configuration for every provider argument automatically.

B.

Run Terraform TRACE logging permanently in public CI logs and assume debug output can never include sensitive configuration or API details. That shortcut risks secrets exposure and noisy operational logs from uncontrolled debug settings. Here the specific shortcut is: Assume placing an import block alone creates a complete and correct Terraform resource configuration for every provider argument automatically.

C.

Run terraform apply against a newly declared resource that already exists and assume Terraform automatically claims it without import. That shortcut risks duplicate creation errors or unwanted replacement when adopting existing infrastructure. Here the specific shortcut is: Assume placing an import block alone creates a complete and correct Terraform resource configuration for every provider argument automatically.

D.

Assume placing an import block alone creates a complete and correct Terraform resource configuration for every provider argument automatically. The foreseeable failure is unsafe resource adoption or unexpected changes due to missing configuration. The safer response is: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

Question 615

A financial institution wants existing load balancers imported through peer-reviewed infrastructure pull requests with exact object IDs. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier. Verify: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.
  2. Implement: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. Verify: Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications.
  3. Implement: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. Verify: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.
  4. Implement: Set TF_LOG and TF_LOG_PATH for a short diagnostic run, protect the output file and scrub any credentials before sharing excerpts externally. Verify: Generate an isolated debug trace, verify the file path is correct and apply a redaction check before archiving only the required error evidence.

Answer & Explanations

Correct answer: C

A.

The test would be relevant: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object. But the offered implementation—Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier.—addresses “Import an existing managed object using the Terraform CLI”. The action needed here is: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

B.

The action is applicable: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. But its proposed test—Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications.—addresses “Import an existing managed object using the Terraform CLI”. This requirement is confirmed instead by: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.

C.

Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. Confirm it through this test: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object. Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.

D.

This action/test pair addresses “Use TF_LOG_PATH to capture a targeted troubleshooting trace securely”. Set TF_LOG and TF_LOG_PATH for a short diagnostic run, protect the output file and scrub any credentials before sharing excerpts externally. Generate an isolated debug trace, verify the file path is correct and apply a redaction check before archiving only the required error evidence. The case instead calls for: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

Question 616

A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier.
  2. Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.
  3. Set TF_LOG to an appropriate diagnostic level for a limited troubleshooting run and disable it after collecting a redacted log in a protected location.
  4. When changing state bindings, use supported terraform state mv or state rm cautiously with backups and verify a full plan afterward; remember state rm does not delete remote infrastructure.

Answer & Explanations

Correct answer: B

A.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier. This addresses “Import an existing managed object using the Terraform CLI”, where the governing principle is: Import associates an existing remote object with Terraform state; it does not automatically guarantee complete configuration, matching all provider attributes or safe ownership. The stated case instead calls for: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

B.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command. Verify the result with this test: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.

C.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Set TF_LOG to an appropriate diagnostic level for a limited troubleshooting run and disable it after collecting a redacted log in a protected location. This addresses “Enable diagnostic Terraform logging only while investigating faults”, where the governing principle is: Terraform emits more detailed internal/provider interactions when debugging is enabled; verbose logs can expose environment information or sensitive values. The stated case instead calls for: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

D.

When changing state bindings, use supported terraform state mv or state rm cautiously with backups and verify a full plan afterward; remember state rm does not delete remote infrastructure. This addresses “Use state mv and state rm only with an explicit migration plan”, where the governing principle is: State operations alter the resource-to-remote-object mapping, so removing an address from state makes Terraform forget ownership while the cloud object remains. The stated case instead calls for: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

Question 617

A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. The infrastructure engineer proposes this change: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. Which mechanism explains why it works?

  1. Import associates an existing remote object with Terraform state; it does not automatically guarantee complete configuration, matching all provider attributes or safe ownership.
  2. Terraform emits more detailed internal/provider interactions when debugging is enabled; verbose logs can expose environment information or sensitive values.
  3. State operations alter the resource-to-remote-object mapping, so removing an address from state makes Terraform forget ownership while the cloud object remains.
  4. Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.

Answer & Explanations

Correct answer: D

A.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Import associates an existing remote object with Terraform state; it does not automatically guarantee complete configuration, matching all provider attributes or safe ownership. That explains “Import an existing managed object using the Terraform CLI”, not the mechanism behind the described change. The relevant principle is: Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.

B.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Terraform emits more detailed internal/provider interactions when debugging is enabled; verbose logs can expose environment information or sensitive values. That explains “Enable diagnostic Terraform logging only while investigating faults”, not the mechanism behind the described change. The relevant principle is: Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.

C.

State operations alter the resource-to-remote-object mapping, so removing an address from state makes Terraform forget ownership while the cloud object remains. That explains “Use state mv and state rm only with an explicit migration plan”, not the mechanism behind the described change. The relevant principle is: Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.

D.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command. The corresponding implementation is: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

Question 618

A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. After implementing this change—Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.—which test most directly validates its intended outcome?

  1. Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.
  2. Reproduce a harmless provider initialization failure with temporary logging, confirm the relevant error is recorded and clear the log level afterward.
  3. Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications.
  4. On a disposable object, inspect state, remove its binding under supervision and confirm the remote object survives while the next plan changes.

Answer & Explanations

Correct answer: A

A.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object. This check is decisive because terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.

B.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Reproduce a harmless provider initialization failure with temporary logging, confirm the relevant error is recorded and clear the log level afterward. That would help test “Enable diagnostic Terraform logging only while investigating faults”, not the outcome required in this scenario. The relevant acceptance check is: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.

C.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications. That would help test “Import an existing managed object using the Terraform CLI”, not the outcome required in this scenario. The relevant acceptance check is: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.

D.

On a disposable object, inspect state, remove its binding under supervision and confirm the remote object survives while the next plan changes. That would help test “Use state mv and state rm only with an explicit migration plan”, not the outcome required in this scenario. The relevant acceptance check is: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.

Question 619

A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Which proposed shortcut most directly risks unsafe resource adoption or unexpected changes due to missing configuration and should therefore be rejected?

  1. Run terraform apply against a newly declared resource that already exists and assume Terraform automatically claims it without import.
  2. Assume placing an import block alone creates a complete and correct Terraform resource configuration for every provider argument automatically.
  3. Run Terraform TRACE logging permanently in public CI logs and assume debug output can never include sensitive configuration or API details.
  4. Run terraform state rm on a production database and assume the provider will delete the live database along with its state entry.

Answer & Explanations

Correct answer: B

A.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Run terraform apply against a newly declared resource that already exists and assume Terraform automatically claims it without import. That shortcut risks duplicate creation errors or unwanted replacement when adopting existing infrastructure. Here the specific shortcut is: Assume placing an import block alone creates a complete and correct Terraform resource configuration for every provider argument automatically.

B.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Assume placing an import block alone creates a complete and correct Terraform resource configuration for every provider argument automatically. The foreseeable failure is unsafe resource adoption or unexpected changes due to missing configuration. The safer response is: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

C.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Run Terraform TRACE logging permanently in public CI logs and assume debug output can never include sensitive configuration or API details. That shortcut risks secrets exposure and noisy operational logs from uncontrolled debug settings. Here the specific shortcut is: Assume placing an import block alone creates a complete and correct Terraform resource configuration for every provider argument automatically.

D.

Run terraform state rm on a production database and assume the provider will delete the live database along with its state entry. That shortcut risks orphaned unmanaged resources and dangerous future duplicate creation plans. Here the specific shortcut is: Assume placing an import block alone creates a complete and correct Terraform resource configuration for every provider argument automatically.

Question 620

A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier. Verify: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.
  2. Implement: Set TF_LOG to an appropriate diagnostic level for a limited troubleshooting run and disable it after collecting a redacted log in a protected location. Verify: Reproduce a harmless provider initialization failure with temporary logging, confirm the relevant error is recorded and clear the log level afterward.
  3. Implement: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. Verify: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.
  4. Implement: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. Verify: Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications.

Answer & Explanations

Correct answer: C

A.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. The test would be relevant: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object. But the offered implementation—Create an appropriate resource block for a preexisting authorized object and run terraform import with its correct resource address and provider-specific identifier.—addresses “Import an existing managed object using the Terraform CLI”. The action needed here is: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

B.

This action/test pair addresses “Enable diagnostic Terraform logging only while investigating faults”. Set TF_LOG to an appropriate diagnostic level for a limited troubleshooting run and disable it after collecting a redacted log in a protected location. Reproduce a harmless provider initialization failure with temporary logging, confirm the relevant error is recorded and clear the log level afterward. The case instead calls for: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration.

C.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. Confirm it through this test: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object. Terraform import blocks enable import to participate in the normal plan and apply workflow, improving reviewability over an untracked one-off command.

D.

The question is set in this situation: A city infrastructure team is transitioning manually created test resources to Terraform while preserving an auditable import step. The action is applicable: Declare an import block mapping an existing object identifier to the intended resource address and review the plan along with its matching resource configuration. But its proposed test—Import a disposable pre-created object, inspect state and run plan to ensure the declared HCL does not propose unintended modifications.—addresses “Import an existing managed object using the Terraform CLI”. This requirement is confirmed instead by: Write a disposable import block and matching resource block, inspect the planned adoption and confirm post-import no-change state for the object.

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