Testing Terraform with Terratest

This should be another short one. One of the advantages of IaC (infrastructure as code) is the fact you can test the things you write. There are multiple tools to test your Terraform configs with, but Gruntwork has created an awesome Go package to test your Terraform configs called Terratest. The advantage to Terratest is you just write Go like you would with anything else and it just works. Here’s an example module to create an ec2 instance:...

March 6, 2020 · 2 min · 355 words · John Hooks

Using Terraform and Ansible Together

This should be a short one. So Ansible has dynamic inventories however I’ve found it a bit slow with VMware if you have a lot of infrastructure to parse through (a lot being around 3,000 VMs in your vCenter and slow being around 15 minutes). I also couldn’t figure out a way to use tags to limit what you’re searching on. This admittedly could have changed recently but since I’ve been using this method I haven’t tried too hard to find out....

February 1, 2020 · 2 min · 219 words · John Hooks

Using Make for SysAdmin Tasks

When most people hear about make they think of compiling source code. While that is often what it’s used for, there are other good uses as well. Here’s an example of using it with Terraform/Ansible to build your infrastructure. Make has some advantages over just using a shell script. One is the native concept of dependencies. You can easily define which targets are dependencies of other targets. Make also has some idempotence baked in (as long as everything isn’t a phony target)....

August 11, 2019 · 3 min · 609 words · John Hooks