terraform-linters/tflint-ruleset-aws
关于
适用于 terraform-provider-aws 的 TFLint 规则集
系统与基础设施实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文TFLint Ruleset for terraform-provider-aws
TFLint ruleset plugin for Terraform AWS Provider
This ruleset focus on possible errors and best practices about AWS resources. In other words, the rules warn against code that might fail when running terraform apply or practices that should be avoided.
Requirements
- TFLint v0.46+
Installation
After configuring TFLint, you can install the plugin by adding a config to .tflint.hcl and running tflint --init:
plugin "aws" {
enabled = true
version = "0.50.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}
For more information about configuration options for this ruleset plugin, see Plugin Configuration.
Getting Started
Terraform is a great tool for Infrastructure as Code. However, many of these tools don't validate provider-specific issues. For example, see the following configuration file:
resource "aws_instance" "foo" {
ami = "ami-0ff8a91507f77f867"
instance_type = "t1.2xlarge" # invalid type!
}
Since t1.2xlarge is an invalid instance type, an error will occur when you run terraform apply. But terraform validate and terraform plan cannot find this possible error in advance. That's because it's an AWS provider-specific issue and it's valid as the Terraform Language.
The goal of this ruleset is to find such errors:

By running TFLint with this ruleset in advance, you can fix the problem before the error occurs in production CI/CD pipelines.
Rules
There are 700+ rules available, see the Rules documentation page for a complete list. Note that not all of them are enabled by default and need to be configured manually (especially rules involving Best Practices).
Building the plugin
Clone the repository locally and run the following command:
$ make
You can easily install the built plugin with the following:
$ make install
Note that if you install the plugin with make install, you must omit the version and source attributes in .tflint.hcl:
plugin "aws" {
enabled = true
}
Add a new rule
If you are interested in adding a new rule to this ruleset, you can use the generator. Run the following command:
$ go run ./rules/generator
Follow the instructions to edit the generated files and open a new pull request.
探索相关项目
加载中…