We use Terraform quite a bit and it has some nice tooling like Terratest where you can essentially call Terraform from within Golang wrapped inside an API with proper error handling.
I wonder if something similar exist for Packer?
To clarify what I what to do with it: This code will be part of a CI/CD workflow, and we would love to automatically build an AWS AMI. But there is some logic involved so ideally we'd love to be able to control packer from golang.