Almost every team that adopts Terraform inherits infrastructure that was built by hand: a bucket created in the console during an incident, a database provisioned years ago, a virtual network nobody dares to touch. The choice is not between managing it with Terraform or leaving it alone β it is between importing it properly and rebuilding it, with the downtime and risk that rebuilding brings. Terraform import is the tool that moves existing resources under Terraform management without recreating them.
This tutorial covers both ways to import: the classic terraform import command and the modern import block, which is the approach you should use for anything that goes through review. You will import a real S3 bucket, generate configuration from the live resource, import a whole set of resources at once, and fix the errors that appear when the import does not go to plan.β¦