Member-only story

Importing Resources into Terraform Management

Effortlessly Bring Existing Infrastructure Under Terraform Management

Luca Berton
5 min readFeb 7, 2024

Introduction

Terraform, developed by HashiCorp, is a widely used tool for implementing Infrastructure as Code (IaC), allowing users to efficiently create, manage, and update infrastructure resources in a predictable manner. However, a common challenge arises when Terraform needs to manage existing infrastructure resources that weren’t initially created with Terraform. This is where the Terraform import command comes into play. Importing resources into Terraform management is a critical operation for integrating unmanaged resources into Terraform's configuration management without recreating them. This article explores how to import resources into Terraform, offering insights into best practices and tips for a smooth transition.

Understanding the Terraform Import Command

The import command in Terraform is designed to bring existing infrastructure resources under Terraform's management. This command requires two primary pieces of information: the address of the Terraform resource in your configuration and the ID of the existing resource in your infrastructure provider.

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet