config lint
v1.6.0
使用YAML中指定的規則來驗證配置文件的命令行工具。配置文件可以是幾種格式之一:Terraform,JSON,YAML,並支持Kubernetes。有用於Terraform的內置規則,可以將自定義文件用於其他格式。
?文件
?貢獻
?問題和錯誤
✏️config-lint:啟動和運行
✏️通過VS代碼遠程容器的開發加速
使用Homebrew在MacOS上安裝最新版本的config-lint:
brew tap stelligent/tap
brew install config-lint或在Linux上手動:
curl -L https://github.com/stelligent/config-lint/releases/latest/download/config-lint_Linux_x86_64.tar.gz | tar xz -C /usr/local/bin config-lint
chmod +rx /usr/local/bin/config-lint針對您的Terraform文件運行內置規則集。例如,如果要針對我們的示例文件運行config-lint:
config-lint -terraform example-files/config您會看到這樣的輸出中的故障和警告違規行為:
[
{
" AssertionMessage " : " viewer_certificate[].cloudfront_default_certificate | [0] should be 'false', not '' " ,
" Category " : " resource " ,
" CreatedAt " : " 2020-04-15T19:24:33Z " ,
" Filename " : " example-files/config/cloudfront.tf " ,
" LineNumber " : 10,
" ResourceID " : " s3_distribution " ,
" ResourceType " : " aws_cloudfront_distribution " ,
" RuleID " : " CLOUDFRONT_MINIMUM_SSL " ,
" RuleMessage " : " CloudFront Distribution must use TLS 1.2 " ,
" Status " : " FAILURE "
},
...您可以在我們的安裝指南中找到更多安裝選項。