@@ -2,11 +2,6 @@ ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
22CODEBUILD_CI ?= false
33SHELL =/usr/bin/env bash
44
5- TFLINT_INFO_ONLY ?= false
6- ifeq ($(TFLINT_INFO_ONLY ) , true)
7- TFLINT_ARGS = --force
8- endif
9-
105# #
116# Environment targets
127# #
@@ -173,23 +168,34 @@ tflint_init:
173168
174169.PHONY : tflint_modules
175170tflint_modules :
176- tflint --chdir=infra/modules/ --recursive --config " $$ (pwd)/.tflint.hcl" ${TFLINT_ARGS}
171+ @# some rules are disabled because modules don't
172+ @# need to define the things those rules check for
173+ tflint --chdir=infra/modules/ --recursive --config " $$ (pwd)/.tflint.hcl" \
174+ --disable-rule " terraform_required_version" \
175+ --disable-rule " terraform_required_providers" \
176+ ${TFLINT_ARGS}
177177
178178.PHONY : tflint_deploy
179179tflint_deploy :
180- tflint --chdir=infra/deployments/deploy/ --recursive --config " $$ (pwd)/.tflint.hcl" ${TFLINT_ARGS}
180+ for root in $( DEPLOY_TF_ROOTS) ; do \
181+ tflint --chdir=" infra/deployments/$$ {root}" --config " $$ (pwd)/.tflint.hcl" ${TFLINT_ARGS} ; \
182+ done ;
181183
182184.PHONY : tflint_forms
183185tflint_forms :
184- tflint --chdir=infra/deployments/forms/ --recursive --config " $$ (pwd)/.tflint.hcl" ${TFLINT_ARGS} \
185- --var-file=" $$ (pwd)/infra/deployments/forms/tfvars/production.tfvars" \
186- --var-file=" $$ (pwd)/infra/deployments/forms/account/tfvars/backends/production.tfvars"
186+ for root in $( FORMS_TF_ROOTS) ; do \
187+ tflint --chdir=" infra/deployments/$$ {root}" --config " $$ (pwd)/.tflint.hcl" ${TFLINT_ARGS} \
188+ --var-file=" $$ (pwd)/infra/deployments/forms/tfvars/production.tfvars" \
189+ --var-file=" $$ (pwd)/infra/deployments/forms/account/tfvars/backends/production.tfvars" ; \
190+ done ;
187191
188192.PHONY : tflint_integration
189193tflint_integration :
190- tflint --chdir=infra/deployments/integration/ --recursive --config " $$ (pwd)/.tflint.hcl" ${TFLINT_ARGS} \
191- --var-file=" $$ (pwd)/infra/deployments/integration/tfvars/integration.tfvars" \
192- --var-file=" $$ (pwd)/infra/deployments/integration/tfvars/backend/integration.tfvars"
194+ for root in $( INTEGRATION_TF_ROOTS) ; do \
195+ tflint --chdir=" infra/deployments/$$ {root}" --config " $$ (pwd)/.tflint.hcl" ${TFLINT_ARGS} \
196+ --var-file=" $$ (pwd)/infra/deployments/integration/tfvars/integration.tfvars" \
197+ --var-file=" $$ (pwd)/infra/deployments/integration/tfvars/backend/integration.tfvars" ; \
198+ done ;
193199
194200# #
195201# Help text
@@ -274,9 +280,14 @@ TASKS
274280 help This help text
275281 fmt Automatically format all Terraform code
276282 lint Run all linting tasks
277- checkov Run Checkov (a Terraform linter) against all Terraform code
278283 lint_ruby Run Rubocop against all Ruby code
279284 spec Run Rspec tests against Ruby and Terraform code
285+
286+ checkov Run Checkov (a Terraform linter) against all Terraform code
287+ Checkov is evaluating how we configure things in AWS.
288+
289+ tflint Run TFLint (a Terraform linter) against all Terraform code.
290+ TFLint is evaluating the quality of our Terraform code.
280291endef
281292export help_tasks
282293
0 commit comments