Packer within Terraform: the dirty way

<p>When it comes to automating&nbsp;<strong>cloud infrastructure</strong>&nbsp;deployments, Infrastructure-As-Code (IaC) tools like Terraform really make the developer&rsquo;s (or DevOps&rsquo;s) life easier. Just recall how painful it was to replicate complex architectures without relying on terraform modules or blueprint templates&hellip; Fortunately,&nbsp;<em>that&rsquo;s water under the bridge,</em>&nbsp;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)&nbsp;<a href="https://cloud.google.com/compute/docs/images" rel="noopener ugc nofollow" target="_blank">Image</a>&nbsp;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,&nbsp;<strong>we cannot easily build VM images with Terraform.&nbsp;</strong>Instead, we need to rely on external processes to build the image, and then reference them in our terraform scripts. But&hellip;&nbsp;<strong>wouldn&rsquo;t it be nice to have the image built within the Terraform&nbsp;</strong>?</p> <p><a href="https://medium.com/@albertogeniola/packer-within-terraform-the-dirty-way-444ffe641b64"><strong>Learn More</strong></a></p>
Tags: dirty Way