packer-plugin-sdk/

directory
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: MPL-2.0

README

Packer Plugin SDK

This SDK enables building Packer plugins. This allows Packer's users to use both the officially-supported builders, provisioners, and post-processors, and custom in-house solutions.

Packer itself is a tool for building identical machine images for multiple platforms from a single source configuration. You can find more about Packer on its website and its GitHub repository.

Packer CLI Compatibility

Packer v1.7.0 or later is needed for this SDK. Versions of Packer prior to that release are still compatible with third-party plugins, but the plugins should use the plugin tooling from inside earlier versions of Packer to ensure complete API compatibility.

Go Compatibility

The Packer Plugin SDK is built in Go, and uses the support policy of Go as its support policy. The two latest major releases of Go are supported by the SDK.

Currently, that means Go 1.14 or later must be used when building a provider with the SDK.

Getting Started

See the Extending Packer docs for a guided tour of plugin development.

Documentation

See the Extending Packer section on the Packer website.

Packer Scope (Plugins VS Core)

Packer Core
  • acts as an RPC client
  • interacts with the user
  • parses (HCL/JSON) configuration
  • manages build as whole, asks plugin(s) to manage the image lifecycle and modify the image being built.
  • discovers plugin(s) and their versions per configuration
  • manages plugin lifecycles (i.e. spins up & tears down plugin process)
  • passes relevant parts of parsed (valid JSON/HCL) and interpolated configuration to plugin(s)
Packer Provider (via this SDK)
  • acts as RPC server
  • executes any domain-specific logic based on received parsed configuration. For builders this includes managing the vm lifecycle on a give hypervisor or cloud; for provisioners this involves calling the operation on the remote instance.
  • tests domain-specific logic via provided acceptance test framework
  • provides Core with template validation, artifact information, and information about whether the plugin process succeeded or failed.

Migrating to SDK from built-in SDK

Migrating to the standalone SDK v1 is covered on the Plugin SDK section of the website.

Versioning

The Packer Plugin SDK is a Go module versioned using semantic versioning.

Contributing

See .github/CONTRIBUTING.md

License

Mozilla Public License v2.0

Directories

Path Synopsis
Code generated by "mapstructure-to-hcl2 -type Config,SSH,WinRM,SSHTemporaryKeyPair"; DO NOT EDIT.
Code generated by "mapstructure-to-hcl2 -type Config,SSH,WinRM,SSHTemporaryKeyPair"; DO NOT EDIT.
ssh
multistep is a library for building up complex actions using individual, discrete steps.
multistep is a library for building up complex actions using individual, discrete steps.
Code generated by "mapstructure-to-hcl2 -type MockBuilder"; DO NOT EDIT.
Code generated by "mapstructure-to-hcl2 -type MockBuilder"; DO NOT EDIT.
The plugin package provides the functionality to both expose a Packer plugin binary and to connect to an existing Packer plugin binary.
The plugin package provides the functionality to both expose a Packer plugin binary and to connect to an existing Packer plugin binary.
example
This is an example plugin.
This is an example plugin.
sdk-internals
Package shell defines code that is common in shells
Package shell defines code that is common in shells
Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT.
Code generated by "mapstructure-to-hcl2 -type Config"; DO NOT EDIT.
Code generated by "mapstructure-to-hcl2 -type Provisioner"; DO NOT EDIT.
Code generated by "mapstructure-to-hcl2 -type Provisioner"; DO NOT EDIT.
config
Code generated by "mapstructure-to-hcl2 -type KeyValue,KeyValues,KeyValueFilter,NameValue,NameValues,NameValueFilter"; DO NOT EDIT.
Code generated by "mapstructure-to-hcl2 -type KeyValue,KeyValues,KeyValueFilter,NameValue,NameValues,NameValueFilter"; DO NOT EDIT.
interpolate/aws/secretsmanager
Package secretsmanager provide methods to get data from AWS Secret Manager
Package secretsmanager provide methods to get data from AWS Secret Manager
Package tmp provides temporary directory helpers.
Package tmp provides temporary directory helpers.
Version helps plugin creators set and track the plugin version using the same convenience functions used by the Packer core.
Version helps plugin creators set and track the plugin version using the same convenience functions used by the Packer core.

Jump to

Keyboard shortcuts

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