Package hcl2template defines code to parse hcl2 template files correctly. In order to configure a packer builder,provisioner,communicator and post processor. Checkout the files in testdata/complete/ to see what a packer config could look like.