Terraform Import Example — AWS EC2 Instance

Do you need to import an EC2 instance into Terraform? Learn how to do this the right way without accidentally deleting your resources.

Sam Gabrail
4 min readJul 27, 2022

This post first appeared on TeKanAid’s blog.

Terraform Import Example in AWS
Terraform Import Example in AWS

Video

Below is a video explanation and demo.

Video Chapters

This video lecture has been taken from my course: Terraform 101 — Certified Terraform Associate

You can skip to the relevant chapters below:

  • 00:00 — Introduction
  • 02:22 — Terraform Import Docs
  • 04:30 — Create EC2 Instance from Console
  • 07:18 — Run Terraform Import Command
  • 08:26 — Create the Terraform Configuration
  • 11:39 — Wrap-up

Overview

--

--

Sam Gabrail

DevOps and Infrastructure Automation Advocate | Content Creator