tfimport

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(svc sdk.Service) sdk.Plugin

New creates a new import plugin.

Types

type ImportRequestMsg

type ImportRequestMsg struct {
	Address string
}

ImportRequestMsg requests navigation to the import plugin with a pre-filled address.

type Input added in v1.12.0

type Input struct {
	// Addr is the resource address to import (terraform's first positional
	// argument).
	Addr string
	// ID is the cloud provider identifier the resource maps to (terraform's
	// second positional argument).
	ID string
	// JSON signals the caller wants JSON-shaped stdout. Import has no stdout
	// content today; the field exists for symmetry with other plugins.
	JSON bool
}

Input is the typed DTO carrying parsed CLI flags into the import plugin's lifecycle. cmd/tfui/import_command.go binds positional args directly into Addr / ID and hands the value to Plugin.Activate.

type Plugin

type Plugin struct {
	sdk.PluginBase
	sdk.ActionRunner
	// contains filtered or unexported fields
}

Plugin implements the standalone import verb. Its input prelude is a two-step form (address, then ID) or a direct confirm; the run/result/render lifecycle is delegated to the embedded ActionRunner.

func (*Plugin) Activate

func (p *Plugin) Activate(input Input) tea.Cmd

Activate stores the typed input and either confirms directly (address + ID both supplied) or opens the two-step form.

func (*Plugin) Configure

func (p *Plugin) Configure(_ map[string]interface{}) error

func (*Plugin) HandleContextChanged added in v1.10.0

func (p *Plugin) HandleContextChanged(ev sdk.ContextChangedEvent) tea.Cmd

HandleContextChanged resets the runner and clears targets on a context switch.

func (*Plugin) Hints

func (p *Plugin) Hints() []sdk.KeyHint

Hints uses q-to-quit (standalone verb) rather than the runner's esc-to-back.

func (*Plugin) Init

func (p *Plugin) Init(deps *sdk.PluginDeps) tea.Cmd

func (*Plugin) Update

func (p *Plugin) Update(msg tea.Msg) (sdk.Plugin, tea.Cmd)

func (*Plugin) View

func (p *Plugin) View(_, _ int) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL