The 'Data, Transformations, and Resources' Pattern in Terraform
summary
Shows that by modeling your domain as data, then using Terraform 0.12 features to transform that data into provider inputs, you avoid massive copy‑paste and fragile indexed resources. Concrete techniques: use typed structured values, flatten + distinct to derive unique lists, nested for expressions to build pair records, set subtract/intersect for conditional creation, and iterate with each.key / each.value so resources are maps you can chain. Terraform 0.13 adds for_each on modules, letting most modules disappear.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:07Terraform 11 limitations
- 2:10Terraform 12 features
- 5:00Collections and iteration
- 7:52Chaining resources
- 10:46Modules in Terraform 13
- 11:07Set operations
- 13:16For expressions
- 15:44Data transformations pattern
- 21:50Benefits of the pattern
- 22:35Summary and Q&A
related talks
48mCodifying Infrastructure with Terraform for the Future
46mTerraform best practices with examples and arguments
46mTerraform best practices with examples and arguments
26mManage Complexity with Terraform: Tips and Tricks from the Trenches
30mMeet the experts: Terraform module design
43mDemystifying Terraform - "Hardcore" to Core Infrastructure... Tool
35mTerraform Practices - The Good, the Bad and the Ugly
40mHow Terraform’s simple graph concepts deploy complex infrastructure as code
