Which operation would bring an existing resource under Terraform management?

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

Which operation would bring an existing resource under Terraform management?

Explanation:
Bringing an existing resource under Terraform management is done by importing. Import records the real-world resource in Terraform’s state and links it to a resource block in your configuration, so Terraform can manage it going forward. It doesn’t create or change the resource by itself; it simply tells Terraform, “this resource already exists here, and you should manage it from now on.” After importing, you typically run plan and apply to converge the actual resource to match your configuration. The other options serve different tasks: initializing sets up the working directory and providers, applying creates or updates resources described in your config, and destroying removes resources.

Bringing an existing resource under Terraform management is done by importing. Import records the real-world resource in Terraform’s state and links it to a resource block in your configuration, so Terraform can manage it going forward. It doesn’t create or change the resource by itself; it simply tells Terraform, “this resource already exists here, and you should manage it from now on.” After importing, you typically run plan and apply to converge the actual resource to match your configuration. The other options serve different tasks: initializing sets up the working directory and providers, applying creates or updates resources described in your config, and destroying removes resources.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy