<p>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.</p>
<p>I wonder if something similar exist for Packer?</p>
<p>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.</p>

CC BY-SA 4.0
2021-06-18T15:42:29.013Z
Not something that I have come across. Packer does have a good templating language so we've not really seen the need to wrap it. We just pass the parameters we need to the template to build our AWS AMIs
Alastair Montgomery
CC BY-SA 4.0
2021-06-22T18:05:14.537Z
Packer is just another command you would run.  Is there anything special about that would cause Golang problems?
chicks
<continuous-integration><infrastructure-as-code><go>
Is it possible to control Packer from golang?
Mathis Van Eetvelde
# Is it possible to control Packer from golang?

(Asked by: username_0 on 2021-06-17)

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.

**Tags:** continuous-integration, infrastructure-as-code, go

> **Comments:**
> **username_1**: Not something that I have come across. Packer does have a good templating language so we've not really seen the need to wrap it. We just pass the parameters we need to the template to build our AWS AMIs  
> **username_2**: Packer is just another command you would run.  Is there anything special about that would cause Golang problems?  

---

## 0 answers

