kb/advanced
Advanced Terraform with Terragrunt and CDKTF, the wrappers and alternative frontends. A custom provider on the Plugin Framework, the internals of the DAG planner, a hierarchy of states across hundreds of resources, blue-green migration of legacy infra, Infracost, OpenTofu in the CI matrix, and the topics where Terraform is the wrong tool.
In 2023 HashiCorp relicensed Terraform under BSL. The community forked it as OpenTofu under the Linux Foundation. The API is compatible, the HCL syntax is the same, and providers are shared. Divergence has started: OpenTofu added state encryption and `exclude` for for_each; Terraform added Stacks. The practical response is matrix CI: run both and catch feature gaps.
Build a custom provider in Go using terraform-plugin-framework. The model: Provider -> Resource (CRUD) or DataSource (R). Each resource needs a Schema plus Create/Read/Update/Delete methods. Terraform Core talks to the provider over gRPC. Deploy with `go install` and dev_overrides, or publish to the Terraform Registry. Write a custom provider when no existing provider covers your API.