nerdexam
HashiCorp

TA-002-P · Question #134

Terraform import command can import resources into modules as well directly into the root of your state.

The correct answer is A. True. True. The terraform import command supports importing existing infrastructure into both the root module and into child modules. To import into a module, you specify the full resource address including the module path, for example: terraform import…

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

Question

Terraform import command can import resources into modules as well directly into the root of your state.

Options

  • ATrue
  • BFalse

How the community answered

(64 responses)
  • A
    95% (61)
  • B
    5% (3)

Explanation

True. The terraform import command supports importing existing infrastructure into both the root module and into child modules. To import into a module, you specify the full resource address including the module path, for example: terraform import module.mymodule.aws_instance.example i-1234567890abcdef0. This tells Terraform to associate the existing resource with the resource defined inside that module in your configuration.

Topics

#Terraform import#State management#Modules#CLI commands

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice