Summary
Packer plugins are an advanced topic, and here we did a super simple example written in Go. The current versions of Packer use RPC for communicating with the main Packer process. This means that plugins could technically be written in any language that supports RPC, but the great SDK complemented by the Packer team’s scaffold plugins in Go makes a fairly complex concept simple via standard interfaces. It is possible to merge a popular plugin into the main Packer binary but this requires approval from the Packer engineering team. There is no reason a Packer plugin can’t be used in production environments so long as it is packaged properly as a signed Git release and cached locally via packer init
.
Data source plugins are quite simple, with inputs and outputs. Builders and provisioners are more complex plugins that may require implementing an additional communicator for standard provisioners to access your build environment. Make sure, when writing a production...