Enable javascript in your browser for better experience. Need to know to enable it? Go here.
Published : Oct 27, 2021
NOT ON THE CURRENT EDITION
This blip is not on the current edition of the Radar. If it was on one of the last few editions, it is likely that it is still relevant. If the blip is older, it might no longer be relevant and our assessment might be different today. Unfortunately, we simply don't have the bandwidth to continuously review blips from previous editions of the Radar. Understand more
Oct 2021
Assess ?

基础设施即代码(infrastructure as code,IaC)的其中一个信条是自动化测试。假设我们的测试金字塔强壮,在底层的代码层面的测试有良好的覆盖,那我们能产出更好而且更安全的基础设施。不幸的是,支持这个领域的工具相当稀缺。Conftest 经常被用于测试 Terraform 的 JSON 和 HCL 代码,然而它是一个普通用途的工具。Regula 是一个有吸引力的替代品。和 Conftest 类似,Regula 以 Open Policy Agent 的 Rego 语言编写的规则,来检查基础设施代码的合法性,但它同时提供了一系列的基础类型来对基础设施配置进行特别的验证。因为两个工具都是基于 Rego 语言的,Regula 规则也可以由 Conftest 运行。然而,Regula 有自己的命令行工具,它可以在流水线上不依赖 Conftest 或者 OPA 来运行测试。我们的开发者认为 Regula 可以节约时间并产出更可读、可维护和简练的测试代码。即便如此,两个工具都只验证基础设施代码。一个完整的测试集应该也去测试基础设施本身,以确保代码被正确地翻译了。

Download the PDF

 

 

 

English | Português 

Sign up for the Technology Radar newsletter

 

 

Subscribe now

Visit our archive to read previous volumes