Importing an Existing Infrastructure

Learn how to import existing resources into Terraform using the terraform import command.

The terraform import command

The terraform import command is used to import existing resources into Terraform. This enables us to take existing resources and bring them under Terraform’s management. Most environments aren’t going to be greenfield deployments with no existing infrastructure. The terraform import command is a way to bring that existing infrastructure under Terraform’s management without altering the underlying resources. The terraform import command can also be useful in situations where an administrator manually created a resource outside of Terraform’s management. That resource needs to be brought into the fold. Ideally, once we’ve adopted Terraform, all new resources will be created and managed through Terraform.

Get hands-on with 1200+ tech skills courses.