Hacking Terraform - Engineer your Migration to IaC
summary
Shows a reproducible way to move existing cloud resources into Terraform by importing resource IDs into state, producing a plan and reading its JSON and the provider schema, then running a 60-line code generator to emit HCL. Uses Terraform CLI commands like terraform import --allow-missing-config and terraform show -json, automates with Kotlin + JUnit and jq/JSONPath, targets Azure in the demo, scales to hundreds or thousands of resources, requires small manual fixes (secrets, provider quirks) but successfully yields a working codebase.
AI-written summary · about
chapters (10)
- 0:00Introduction to Terraform migration
- 1:53Why migrate to Terraform
- 4:03How Terraform works internally
- 9:00Reverse engineering Terraform state
- 14:54Picking cloud resources for import
- 21:30Importing resources into state
- 28:59Generating Terraform code
- 37:14How the code generator works
- 40:46Lessons learned from automation
- 42:17Future of Terraform import
related talks
01h 20mTerraform Deep Dive
48mInfrastructure as Code with Terraform on Azure
21mTerraform Search: Discover and import resource in bulk
25mImporting Terraform Resources the Safe Way
33mBuilding applications with infrastructure as code
36mInfrastructure as Code with Terraform
37mTerraform & CI/CD
28mLessons Learned from Writing Thousands of Lines of IaC
