Packer within Terraform: the dirty way
<p>When it comes to automating <strong>cloud infrastructure</strong> deployments, Infrastructure-As-Code (IaC) tools like Terraform really make the developer’s (or DevOps’s) life easier. Just recall how painful it was to replicate complex architectures without relying on terraform modules or blueprint templates… Fortunately, <em>that’s water under the bridge,</em> by now.</p>
<p>However, even if Terraform covers nicely most of the infrastructure setup tasks, there are some grey areas in which we need to rely on different tools/processes to make our infrastructure work as we expect.</p>
<h2>The issue</h2>
<p>Have you ever needed to build a simple Google Cloud Engine (GCE) <a href="https://cloud.google.com/compute/docs/images" rel="noopener ugc nofollow" target="_blank">Image</a> to be used as an infrastructural component in your architecture? For instance, a simple iptables-based network appliance, a bastion-host, a squid-proxy appliance and so on? If yes, then you probably know that creating VM image is not what Terraform does. In other words, <strong>we cannot easily build VM images with Terraform. </strong>Instead, we need to rely on external processes to build the image, and then reference them in our terraform scripts. But… <strong>wouldn’t it be nice to have the image built within the Terraform </strong>?</p>
<p><a href="https://medium.com/@albertogeniola/packer-within-terraform-the-dirty-way-444ffe641b64"><strong>Learn More</strong></a></p>