一句话:提出 TerraMod,利用 changelog、API schema 与弃用链接构建迁移上下文来引导 LLM,自动完成 Terraform 跨 Provider 版本的破坏性变更升级。
Terraform 是主流的 Infrastructure-as-Code 工具,但其 provider 演化迅速、破坏性变更频繁,加之文档分散、官方支持有限,用户往往推迟升级并累积技术债。本文提出 TerraMod 框架,旨在自动化跨 provider 版本的 Terraform 代码迁移。其核心思路是:从外部来源——changelog、API schema 以及弃用链接——抽取并构造“迁移上下文”,把这一结构化的演化知识作为提示注入 LLM,从而引导模型生成有效的升级改写,而非依赖朴素的通用提示。作者在 AWS Provider 真实破坏性变更上进行了评估,结果显示 TerraMod 优于标准 prompting 技术,能够实现可靠的代码升级,为 IaC 代码的自动化维护提供了可行路径。
Terraform is a popular Infrastructure-as-Code (IaC) tool for managing cloud environments, but its providers evolve rapidly, introducing frequent breaking changes. These updates pose migration challenges due to fragmented documentation and limited support, leading to delayed upgrades and accumulated technical debt. In this paper, we present TerraMod, a framework that automates Terraform code migration across provider versions. It leverages external sources — changelogs, API schemas, and deprecation links to construct a migration context that guides LLMs towards effective upgrades. Evaluated on real-world breaking changes from the AWS Provider, TerraMod outperforms standard prompting techniques, enabling reliable upgrades.
@inproceedings{paperbot12032,
title = {Automating Terraform Code Migration through Provider Evolution Knowledge},
author = {Pranjal Gupta and Pooja Aggarwal and Brent Paulovicks and Prateeti Mohapatra and Rong Lee and Vadim Sheinin},
booktitle = {ICSE},
year = {2026},
doi = {10.1145/3786582.3786841}
}