plugin

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package plugin runs external discovery commands for providers that do not implement list resources.

A plugin is any command that prints one JSON object per line:

{"type":"vault_policy","identity":{"id":"ci"},"display_name":"ci","import_id":"ci"}
{"error":"sys/auth: permission denied"}
{"done":true}

"type" is the Terraform resource type. "identity" holds the attributes to match against state; when state has no resource identity they are compared with the instance's attributes (usually {"id": ...} is enough). An "error" line reports partial coverage without failing the run. A "done": true line confirms that the check finished, even when it found no objects. "unverified": true marks objects whose cluster or account state cannot confirm: they match only as unverified, unless the user states that the states belong to the scanned cluster (-plugin-cluster-states).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(out []byte, source string) ([]model.Resource, []error, bool, error)

Parse decodes plugin output and reports whether a done line was seen.

func Run

func Run(ctx context.Context, command, name string) ([]model.Resource, []error, bool, error)

Run executes command with sh -c and reports whether a done line was seen. Warnings are partial failures; the error is returned when the command fails or prints invalid output. Reports and errors use name (plugin1, plugin2, ...), never the command line: it may carry tokens, and shell quoting makes it impossible to cut out safely.

Types

This section is empty.

Jump to

Keyboard shortcuts

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