Refactoring HCL organization-wide with OpenRewrite
At some point, every larger infrastructure-as-code project reaches a stage where changes stop being local. Updating a module version, changing an input contract, or migrating between architectural approaches suddenly requires coordinated changes across many places and often across multiple repositories.
In theory, these are “simple” updates: bumping a version, removing an input, adding a new configuration block. In practice, manually refactoring such changes is time-consuming, error-prone, and difficult to review safely. Text-based scripts built around tools like grep or sed help only up to a point. They do not understand the structure of the configuration, are sensitive to formatting, and, most importantly, are not deterministic. Each execution requires another round of manual verification to ensure the result is actually correct.



