12

Developing Packer Plugins

In the previous chapter, we covered basic automation for Packer builds. Up until now, most of Packer’s existing builder use cases should be familiar, but what about the functionalities Packer lacks? Since Packer is open source, you could fork and edit the code base, but it’s much easier to write a plugin. HashiCorp’s projects use Go and Remote Procedure Call (RPC) for plugin development, which allows plugins to be developed as standalone Go binaries or to be built into the project itself. Plugins come in four flavors: builders, provisioners, post-processors, and data sources. Each function is defined by an interface that must be implemented. Packer makes this easy to do by providing templates. We’ll explore the templates ...

Get HashiCorp Packer in Production now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.