tfui latest

Import

Overview

Imports existing infrastructure into terraform state, like terraform import. When it finishes or you cancel, Esc returns you to the screen you came from.

Screenshot

Import

Interactive (TUI)

Import has no key on Home. Press n in State to import with the address under the cursor filled in.

Keybindings

Key Action When
Enter Submit the address, then the ID; an empty answer cancels Prompt
y / Y / Enter Confirm import Confirming
n / N / Esc Cancel Confirming
p Navigate to plan (not offered by standalone tfui import, which has no Plan) Done
ctrl+r Retry Error
Esc Back to the screen you came from Idle, Done, Error

Flow

Prompts → Confirming → Loading → Done/Error
  1. tfui asks “Resource address:” (filled in when you came from State), then “Resource ID:”.
  2. It asks “Import <id> as <address>?”
  3. On y, it runs terraform import <address> <id>.
  4. When it finishes, the plan is marked stale: Plan re-plans the next time you open it. Esc returns you to where you started; p opens Plan instead.

Command Line (CLI)

tfui import <address> <id>

With a terminal attached, tfui asks for confirmation; a headless run imports without asking.

Exit codes: see CLI I/O contract.

Equivalence

Goal CLI TUI
Import a resource tfui import <address> <id> From state: n → Enter → type ID → Enter → y
  • State Browser – browse resources and import from context
  • Plan – see the effect of importing (resource now tracked)

Edit this page on GitHub