Synthesizing Tiered VPC in Terraform Jan 12, 2021 Today’s Mathematics Dynamic VPC x Tiered Subnet Calculator = Tiered VPC Observing Abstractions In hindsight, the Dynamic VPC module should instead be called Simple VPC. It provides a general VPC tier including a public subnet (/24), a private subnet (/24) and NAT Gateways per AZ. The interface is simple because there is minimal focus on subnetting due to the internal subnet generation. Routing is automatic and the module outputs can be consumed for peering. ...
Tiered Subnet Calculator in Terraform Dec 1, 2020 I’ve been thinking about adding support for building tiered subnets of any valid size for the next iteration of the Dynamic VPC Module. It occurred to me that auto subnet generation inside the module actually makes the subnetting less dynamic. Furthermore, auto subnet calculation should be in assistance to the process of allocating subnets and should not be fed directly as input to the VPC module. This is due to the fact that order matters only for the subnetting calculation. ...
Hash Server 9000 in Go Oct 10, 2020 I took an internal dev challenge at work a while back because I wanted to learn more Go since I have an OO background and was not familiar with the procedural way of thinking. The goal was to build a simple non-persistent password hashing service using only the standard library while demonstrating the use of concurrency with the endpoint requirements below. Reading the blue and white book was definitely key to gaining deeper insight. ...
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 Pipleline 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? 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