TFLint ruleset plugin for Terraform Google Cloud Platform provider (fork of https://github.com/terraform-linters/setup-tflint)
- TFLint v0.42+
- Go v1.22
You can install the plugin by adding a config to .tflint.hcl
and running tflint --init
:
plugin "google" {
enabled = true
version = "0.31.3"
source = "github.com/epidemicsound/tflint-ruleset-google"
}
For more configuration about the plugin, see Plugin Configuration.
100+ rules are available. See the documentation.
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 "google" {
enabled = true
}
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.
- Add your changes to a PR (include a commit with the version bump into the PR), get review, merge to main.
- Wait for a successful completion of the build on main.
- Fetch the latest state of main to your local machine, create a tag and push it to remote
(i.e.
git checkout main && git pull && git tag v0.31.2 && git push origin v0.31.2
). - Wait for the release workflow to finish.
- Go to releases, your new release will be in the
draft
state. - Click edit -> add the release notes (or auto-generate them) -> Publish release.
- Build the binary
go build
- Move the binary to TFLint plugin folder
mkdir -p ~/.tflint.d/plugins/github.com/epidemicsound/tflint-ruleset-google/local_test/
mv tflint-ruleset-google ~/.tflint.d/plugins/github.com/epidemicsound/tflint-ruleset-google/local_test/
- Update
.tflint
config:
plugin "google" {
enabled = true
deep_check = true
version = "local_test"
source = "github.com/epidemicsound/tflint-ruleset-google"
}
- Run tflint:
tflint --config /git/infra/.tflint.hcl --call-module-type=all