Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/terraform-linters/tflint-ruleset-template
TFLint ruleset template
https://github.com/terraform-linters/tflint-ruleset-template
terraform tflint tflint-ruleset
Last synced: 3 months ago
JSON representation
TFLint ruleset template
- Host: GitHub
- URL: https://github.com/terraform-linters/tflint-ruleset-template
- Owner: terraform-linters
- License: 0bsd
- Created: 2019-11-09T13:13:35.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-02T13:42:42.000Z (3 months ago)
- Last Synced: 2024-11-02T14:25:56.888Z (3 months ago)
- Topics: terraform, tflint, tflint-ruleset
- Language: Go
- Homepage:
- Size: 175 KB
- Stars: 33
- Watchers: 5
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TFLint Ruleset Template
[![Build Status](https://github.com/terraform-linters/tflint-ruleset-template/workflows/build/badge.svg?branch=main)](https://github.com/terraform-linters/tflint-ruleset-template/actions)This is a template repository for building a custom ruleset. You can create a plugin repository from "Use this template". See also [Writing Plugins](https://github.com/terraform-linters/tflint/blob/master/docs/developer-guide/plugins.md).
## Requirements
- TFLint v0.42+
- Go v1.23## Installation
TODO: This template repository does not contain release binaries, so this installation will not work. Please rewrite for your repository. See the "Building the plugin" section to get this template ruleset working.
You can install the plugin with `tflint --init`. Declare a config in `.tflint.hcl` as follows:
```hcl
plugin "template" {
enabled = trueversion = "0.1.0"
source = "github.com/terraform-linters/tflint-ruleset-template"signing_key = <<-KEY
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGCqS2YBEADJ7gHktSV5NgUe08hD/uWWPwY07d5WZ1+F9I9SoiK/mtcNGz4P
JLrYAIUTMBvrxk3I+kuwhp7MCk7CD/tRVkPRIklONgtKsp8jCke7FB3PuFlP/ptL
SlbaXx53FCZSOzCJo9puZajVWydoGfnZi5apddd11Zw1FuJma3YElHZ1A1D2YvrF
...
KEY
}
```## Rules
|Name|Description|Severity|Enabled|Link|
| --- | --- | --- | --- | --- |
|aws_instance_example_type|Example rule for accessing and evaluating top-level attributes|ERROR|✔||
|aws_s3_bucket_example_lifecycle_rule|Example rule for accessing top-level/nested blocks and attributes under the blocks|ERROR|✔||
|google_compute_ssl_policy|Example rule with a custom rule config|WARNING|✔||
|terraform_backend_type|Example rule for accessing other than resources|ERROR|✔||## 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
```You can run the built plugin like the following:
```
$ cat << EOS > .tflint.hcl
plugin "template" {
enabled = true
}
EOS
$ tflint
```