Create a Custom VM Image for Google Compute Engine
The code here serves to illustrate the article Use HashiCorp's Packer to create a Custom VM Image for Cloud Provider
The article is a simple step-by-step process to build a Google Custom VM with Apache Kafka preinstalled and configured with a couple of topics already created.
If you follow through the code examples on the page you should arrive at the same files etc.
In fact the difference in code between this one and the previous blog is one file - kafka-instance-template.json - which has around 25 lines. Not much.
You will have to install Packer for this to work.