tflint-plugin-sdk

module
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2021 License: MPL-2.0

README

TFLint plugin SDK

Build Status GitHub release go.dev reference

TFLint plugin SDK for building custom rules.

NOTE: This plugin system is experimental. This means that API compatibility is frequently broken.

Requirements

  • TFLint v0.24+
  • Go v1.15

Usage

Please refer to tflint-ruleset-template for an example plugin implementation using this SDK.

For more details on the API, see tflint and helper packages on pkg.go.dev.

Architecture

architecture

This plugin system uses go-plugin. TFLint launches the plugin as a sub-process and communicates with the plugin over RPC. The plugin acts as a server, while TFLint acts as a client that sends inspection requests to the plugin.

On the other hand, the plugin sends various requests to a server (TFLint) to get detailed runtime contexts (e.g. variables and expressions). This means that TFLint and plugins can act as both a server and a client.

Directories

Path Synopsis
Package helper contains implementations for plugin testing.
Package helper contains implementations for plugin testing.
Package plugin contains the implementations needed to make the built binary act as a plugin.
Package plugin contains the implementations needed to make the built binary act as a plugin.
Package terraform contains structures for Terraform's alternative representations.
Package terraform contains structures for Terraform's alternative representations.
Package tflint contains implementations and interfaces for plugin developers.
Package tflint contains implementations and interfaces for plugin developers.
client
Package client contains the implementations required for plugins to act as a client.
Package client contains the implementations required for plugins to act as a client.
server
Package server contains the interfaces that the host process should satisfy.
Package server contains the interfaces that the host process should satisfy.

Jump to

Keyboard shortcuts

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