Learn How to Import Infrastructure Into Terraform
Terraform not only allows you to create and manage greenfield infrastructure, but also to manage existing resources for a variety of popular infrastructure providers. You can migrate manually created infrastructure to Terraform in order to use its powerful configuration language and workflow over the entire lifecycle of your project.
Consider the scenario where you are already running a database in the cloud, and that database is being actively used by your business applications. Rather than destroying the database and recreating a new one from scratch with Terraform, you can tell Terraform about the existing resources and start managing them with Terraform from that point forward.
» Learn to use Terraform import
In this hands-on tutorial, you will import an existing Docker container and Docker image into a Terraform project’s state and create configuration to match.
» Manage existing infrastructure
The typical Terraform workflow involves first writing Terraform configuration and then planning and applying that configuration to create new infrastructure. Once you become comfortable creating and managing infrastructure with code, eventually you'll encounter a situation where you wish to import existing infrastructure into Terraform without destroying or recreating it. The terraform import
command can be used to import infrastructure into a Terraform project’s state.
Note: The import command does not create Terraform configuration. Users will need to create configuration to match the state created by the import process.
Follow the steps of this hands-on tutorial to start using Terraform with your existing infrastructure.
Sign up for the latest HashiCorp news
More blog posts like this one
New Terraform integrations with Crowdstrike, Datadog, JFrog, Red Hat, and more
12 new Terraform integrations from 9 partners provide more options to automate and secure cloud infrastructure management.
Terraform delivers launch-day support for Amazon S3 Tables, EKS Hybrid Nodes, and more at re:Invent
The Terraform provider for AWS now enables users to manage a variety of new services just announced at re:Invent.
HashiCorp at re:Invent 2024: Infrastructure Lifecycle Management with AWS
A recap of HashiCorp infrastructure news and developments on AWS from the past year, from a new provider launch to simplifying infrastructure provisioning and more.