Import Resources

Study the concept of importing resources in Terraform.

Overview

As we go through this course, we may wonder whether Terraform can be used in reverse to manage the control resources we created outside of Terraform.

In this lesson, we are going to do just that by using this sequence of steps:

  • Create some resources.
  • Extract the resource IDs.
  • Lose the Terraform state.
  • Use the resource IDs to import with Terraform.

Importance

Knowing how to import resources while using Terraform can be beneficial in practice, but this lesson could be skipped if we don’t need to use the feature.

Create a remote VPC by hand

We have created and initialized a Terraform module named ltthw_import. Furthermore, we created a subnet and VPC.

Note: You don’t have to run the commands to create Terraform or file modules, as we have already done that for you. Follow the steps and check the output.

Get hands-on with 1400+ tech skills courses.