Having AI write IaC is no longer unusual. It can add a module, change a few resources, and draft policy much faster than a person.
That speed brings a different problem. A change can pull in unrelated resources. Terraform that is perfectly valid can still delete or replace resources, or loosen permissions. Those issues are not always obvious in code review.
As the volume grows, reviewing every line by hand stops scaling. Handing the review to another AI adds another opinion, not another guarantee.
The real question is this: how can AI keep writing and iterating while its mistakes are caught consistently and kept out of production?
现在让 AI 写 IaC 已经不算新鲜事。补一个 Module、改几个资源、顺手生成 Policy,速度通常比人工快得多。
麻烦也跟着变了。一次改动可能混进无关资源,语法完全正确的 Terraform,也可能带来 Delete、Replace 或权限放宽。这些问题不一定能在 Code Review 里一眼看出来。
代码越来越多,全部靠人逐行检查不太现实;把 Review 再交给 AI,也只是多了一层判断,并没有多一层保证。
其实根本问题是:AI 可以继续写、继续试,但它的错误怎么被稳定地发现,又怎么避免进入生产环境?
