nerdexam
HashiCorpHashiCorp

TA-002-P · Question #141

TA-002-P Question #141: Real Exam Question with Answer & Explanation

The correct answer is B: Update the configuration file to include the new resources.. {"question_number": 4, "question": "You want to use terraform import to start managing infrastructure that was not originally provisioned through infrastructure as code. Before you can import the resource's current state, what must you do in order to prepare to manage these resou

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

You want to use terraform import to start managing infrastructure that was not originally provisioned through infrastructure as code. Before you can import the resource's current state, what must you do in order to prepare to manage these resources using Terraform?

Options

  • ARun terraform refresh to ensure that the state file has the latest information for existing
  • BUpdate the configuration file to include the new resources.
  • CShut down or stop using the resources being imported so no changes are inadvertently
  • DModify the Terraform state file to add the new resources.

Explanation

{"question_number": 4, "question": "You want to use terraform import to start managing infrastructure that was not originally provisioned through infrastructure as code. Before you can import the resource's current state, what must you do in order to prepare to manage these resources using Terraform?", "correct_answer": "B. Update the configuration file to include the new resources.", "explanation": "terraform import maps an existing real-world resource into Terraform state, but it requires a matching resource block to already exist in your configuration files. Without a configuration block defining the resource, the import will fail. Running terraform refresh only updates existing state; shutting down resources is unnecessary; and manually editing the state file is unsupported and dangerous.", "generated_by": "claude-sonnet", "llm_judge_score": 4}

Topics

#terraform import#configuration files#resource declaration#managing existing infrastructure

Community Discussion

No community discussion yet for this question.

Full TA-002-P PracticeBrowse All TA-002-P Questions