Which action brings existing external resources under Terraform management by creating an entry in the state file?

Prepare for the HashiCorp Terraform Associate Exam. Utilize flashcards and multiple-choice questions with detailed hints and explanations. Boost your confidence and be ready for success!

Multiple Choice

Which action brings existing external resources under Terraform management by creating an entry in the state file?

Explanation:
Bringing an existing external resource under Terraform management means adding it to Terraform's state so Terraform can track and manage it alongside resources it creates. The import operation creates a state entry that links the resource described in your configuration to the real resource instance, using the provider’s identifying ID. This does not create the resource itself; it only tells Terraform, “here’s an existing resource that you should now manage.” After importing, plans and applies can update or delete the resource according to the config. Other actions don’t accomplish this: destroying removes a resource; refreshing only updates the state to match reality; initializing the backend sets up where state is stored, not what resources Terraform manages.

Bringing an existing external resource under Terraform management means adding it to Terraform's state so Terraform can track and manage it alongside resources it creates. The import operation creates a state entry that links the resource described in your configuration to the real resource instance, using the provider’s identifying ID. This does not create the resource itself; it only tells Terraform, “here’s an existing resource that you should now manage.” After importing, plans and applies can update or delete the resource according to the config. Other actions don’t accomplish this: destroying removes a resource; refreshing only updates the state to match reality; initializing the backend sets up where state is stored, not what resources Terraform manages.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy