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