Import Existing Resources
Last updated
What is Import Existing Resources?
Terraform state import is a command used to bring existing resources under Terraform management. It allows you to add resources that were created outside of Terraform (e.g., manually or by other tools) into your Terraform state. The command takes two main arguments: the Terraform resource address and the real-world resource identifier. When executed, it adds the resource to the state file without modifying the actual infrastructure. This is useful for adopting Terraform in environments with existing resources, or for recovering from scenarios where state and reality have diverged. After importing, you need to write the corresponding configuration in your Terraform files to match the imported resource.
In Terraform v1.5.0 and later you can also create import blocks in any Terraform configuration file.
Free resources to learn Import Existing Resources
More in stage 10: State
Import Existing Resources: common questions
Can I learn Import Existing Resources in Hindi?
This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Import Existing Resources in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.
Is this Import Existing Resources tutorial for beginners?
It is lesson 44 of 110 in the free Terraform roadmap, in stage 10, State. If you are new to Terraform, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.