Go Modules Replace Use Case: Terratest and LocalStack Sep 23, 2020 At work we’re planning on having our IaC to grow up a bit. We’re really wanting it to get a job and start contributing more around here. Something like a shiny new Terraform Pipeline would be nice. That means we need to get our Terraform testing sorted out. I came across this HashiCorp video called Testing Infrastructure as Code on Localhost where Samuel Kihahu talks about combining Terratest + Terraform + LocalStack to allow him to test Terraform modules locally. ...
Expanding Function Arguments in Terraform Aug 23, 2020 The other day I was wondering if it was possble to unpack a list of elements as args to a function in Terraform similar to * in Python or splat in Ruby? Because this code will give invalid function argument errors: locals { new_bits = [4,4,8,4] subnets = cidrsubnets("10.1.0.0/16", local.new_bits) # <= can i unpack? } It turns out you can do this with the expansion symbol ... (three periods). Not to be confused with the Unicode ellipsis character. ...
Dynamic VPC Module in Terraform 0.12 Aug 21, 2020 TL;DR Just show me the code! This is a Dynamic VPC Module that builds a redundant network architecture in AWS based on structured input using for_each and for constructs. It will build a VPC with private and public subnets per AZ with the proper routing and labeling. Here is the related VPC network diagram for visual reference. Preface I was planning on releasing this blog post shortly after Terraform 0.12 released but there were unexpected delays. ...
A Storm is Brewing Jan 2, 2020 “Some callin it fate while some others remain torn, some callin it rain cuz thats when I brainstorm.” - Evidence