File tree Expand file tree Collapse file tree
aws/network/modules/vpc-endpoints/s3-vpc-endpoint Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ MODULEFILES := $(wildcard * .tf)
2+ TFLINTRC ?= ../../.tflint.hcl
3+ TFDOCSRC ?= ../../.terraform-docs.yml
4+
5+ .PHONY : default
6+ default : checkfmt validate docs lint
7+
8+ .PHONY : checkfmt
9+ checkfmt : .fmt
10+
11+ .PHONY : fmt
12+ fmt : $(MODULEFILES )
13+ terraform fmt
14+ @touch .fmt
15+
16+ .PHONY : validate
17+ validate : .validate
18+
19+ .PHONY : docs
20+ docs : README.md
21+
22+ .PHONY : lint
23+ lint : .lint
24+
25+ .lint : $(MODULEFILES ) .lintinit
26+ tflint --config=$(TFLINTRC )
27+ @touch .lint
28+
29+ .lintinit : $(TFLINTRC )
30+ tflint --init --config=$(TFLINTRC ) --module
31+ @touch .lintinit
32+
33+ README.md : $(MODULEFILES )
34+ terraform-docs --config " $( TFDOCSRC) " markdown table . --output-file README.md
35+
36+ .fmt : $(MODULEFILES )
37+ terraform fmt -check
38+ @touch .fmt
39+
40+ .PHONY : init
41+ init : .init
42+
43+ .init : versions.tf .dependencies
44+ terraform init -backend=false
45+ @touch .init
46+
47+ .validate : .init $(MODULEFILES ) $(wildcard * .tf.example)
48+ echo | cat - $(wildcard * .tf.example) > test.tf
49+ if AWS_DEFAULT_REGION=us-east-1 terraform validate; then \
50+ rm test.tf; \
51+ touch .validate; \
52+ else \
53+ rm test.tf; \
54+ false ; \
55+ fi
56+
57+ .dependencies : * .tf
58+ @grep -ohE \
59+ " \b(backend|provider|resource|module) ['\" ][[:alpha:]][[:alnum:]]*|\bsource *=.*" * .tf | \
60+ sed " s/['\" ]//" | sort | uniq | \
61+ tee /tmp/initdeps | \
62+ diff -q .dependencies - > /dev/null 2>&1 || \
63+ mv /tmp/initdeps .dependencies
64+
65+ .PHONY : clean
66+ clean :
67+ rm -rf .dependencies .fmt .init .lint .lintinit .terraform* .validate
Original file line number Diff line number Diff line change @@ -6,11 +6,16 @@ export TFDOCSRC := $(CURDIR)/.terraform-docs.yml
66
77SUBMODULES := $(filter-out \
88 % .md,\
9- $(wildcard \
10- platform/modules/* \
11- platform \
12- aws/* /modules/* \
13- aws/* \
9+ $(foreach dir,\
10+ $(wildcard \
11+ platform/modules/* \
12+ platform \
13+ aws/* /modules/* \
14+ aws/* \
15+ platform/modules/* /* \
16+ aws/* /modules/* /* \
17+ ) ,\
18+ $(if $(wildcard $(dir ) /* .tf) ,$(dir ) ,) \
1419 ) \
1520 )
1621SUBMODULEMAKEFILES := $(foreach module,$(SUBMODULES ) ,$(module ) /makefile)
You can’t perform that action at this time.
0 commit comments