Terraform Evaluation Tool

Summary

A tight feedback loop is important when developing code. Terraform is no different. At times, it would be helpful to have a quick way to test function calls. In this post, I introduce a tool I have created that does just that.

At times when I am developing Terraform it would be helpful to be able to quickly test a function call. Typically, when writing regular expressions or building subnets. In these situations it can be painful to make a change and do a terraform plan to see what the changes would be.

For this reason, I created a docker image that will take the first argument passed and evaluate it with Terraform.

> terraform-eval "cidrsubnet(\"172.16.0.0/12\", 4, 2)"
172.18.0.0/16

Instructions and more examples on how to use the tool are available in the Github repo.

https://github.com/webdevwilson/terraform-eval

Avatar
Kerry Wilson
Principal Cloud Architect

Coming from a development background, Kerry’s focus is on application development, infrastructure and security automation, and applying agile software development practices to IT operations in the cloud.

Related