Body: <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>
  
Comments: CC BY-SA 4.0
Comments: 2021-06-18T15:42:29.013Z
Comments: 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
Comments: Alastair Montgomery
Comments: CC BY-SA 4.0
Comments: 2021-06-22T18:05:14.537Z
Comments: Packer is just another command you would run.  Is there anything special about that would cause Golang problems?
Comments: chicks
Tags: <continuous-integration><infrastructure-as-code><go>
Title: Is it possible to control Packer from golang?
UserDisplayName: Mathis Van Eetvelde
ThreadText: # 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
  
  