Where React for IaC came from
The article explains the origin of using React-like syntax for Infrastructure as Code (IaC) through a project called Dinghy, which emerged from the limitations of managing Terraform configurations across multiple environments. Traditional tools like CDKTF improved programmability but still required verbose boilerplate and manual resource wiring. By leveraging TSX's natural nesting structure, the author created a system where infrastructure code visually mirrors its runtime architecture, simplifying composition and reducing errors.
- ▪The author initially maintained a complex Terraform codebase with duplicated configurations across environments.
- ▪CDKTF allowed writing infrastructure in TypeScript but introduced boilerplate and required manual handling of resource dependencies.
- ▪TSX syntax was found to naturally reflect the hierarchical structure of cloud infrastructure, enabling a more intuitive IaC approach.
- ▪Dinghy uses React's TSX syntax and tree-walking capabilities without React's runtime features like state or effects.
- ▪The system renders infrastructure definitions once into Terraform JSON, avoiding the complexity of React's reactivity model.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 312970) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } mrduguo Posted on May 17 Where React for IaC came from #react #terraform #cdktf #drawio Dinghy Introduction Series (2 Part Series) 1 Introduction to Dinghy: a Swiss-army knife for everyday engineering 2 Where React for IaC came from This is the first technical post in the Dinghy series, and it is the one I had to write before any of the others made sense.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).