Skip to content

Commit 2d9dd94

Browse files
committed
chore(deps): updating the repository inline with the upstream template
1 parent 54bb7a7 commit 2d9dd94

File tree

8 files changed

+93
-117
lines changed

8 files changed

+93
-117
lines changed

.commitlintrc.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
rules:
3+
body-leading-blank: [1, always]
4+
body-max-line-length: [2, always, 100]
5+
footer-leading-blank: [1, always]
6+
footer-max-line-length: [2, always, 100]
7+
header-max-length: [2, always, 100]
8+
subject-case:
9+
- 2
10+
- never
11+
- [sentence-case, start-case, pascal-case, upper-case]
12+
subject-empty: [2, never]
13+
subject-full-stop: [2, never, "."]
14+
type-case: [2, always, lower-case]
15+
type-empty: [2, never]
16+
type-enum:
17+
- 2
18+
- always
19+
- [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]

.gitignore

+12-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,16 @@ terraform.rc
2929
# Other
3030
.DS_Store
3131
todo.md
32+
33+
# Ignore vim swap files
34+
*.swp
35+
*.swo
36+
37+
# Ignore meld diff files
3238
*.orig
33-
*.swp
39+
*.backup
40+
*.rej
41+
42+
# Ignore lambda zip files and build directories
43+
*.zip
44+
builds/

.terraform-docs.yaml .terraform-docs.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
formatter: markdown
21
#header-from: .header.md
32
settings:
43
anchor: true
@@ -12,10 +11,18 @@ settings:
1211
type: true
1312
lockfile: false
1413

15-
sort:
16-
enabled: true
17-
by: required
14+
formatter: "markdown table"
1815

1916
output:
2017
file: README.md
2118
mode: inject
19+
20+
sections:
21+
show:
22+
- providers
23+
- inputs
24+
- outputs
25+
26+
sort:
27+
enabled: true
28+
by: required

.tflint.hcl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
plugin "aws" {
22
enabled = true
3-
version = "0.32.0"
3+
version = "0.34.0"
44
source = "github.com/terraform-linters/tflint-ruleset-aws"
55
}
66

77
plugin "terraform" {
88
enabled = true
9-
version = "0.7.0"
9+
version = "0.9.1"
1010
source = "github.com/terraform-linters/tflint-ruleset-terraform"
1111
}
1212

Makefile

+49-51
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,23 @@ examples:
3636

3737
documentation:
3838
@echo "--> Generating documentation"
39-
@terraform-docs markdown table --output-file ${PWD}/README.md --output-mode inject .
39+
@terraform-docs .
4040
$(MAKE) documentation-modules
4141
$(MAKE) documentation-examples
4242

4343
documentation-modules:
4444
@echo "--> Generating documentation for modules"
45-
@if [ -d modules ]; then \
46-
find modules -type d -mindepth 1 -maxdepth 1 -exec terraform-docs markdown table --output-file README.md --output-mode inject {} \; ; \
47-
fi
45+
@find . -type d -regex '.*/modules/[a-za-z\-_$$]*' -not -path '*.terraform*' 2>/dev/null | while read -r dir; do \
46+
echo "--> Generating documentation for module: $$dir"; \
47+
terraform-docs $$dir; \
48+
done;
4849

4950
documentation-examples:
50-
@echo "--> Generating documentation examples"
51-
@if [ -d examples ]; then \
52-
find examples -type d -mindepth 1 -maxdepth 1 -exec terraform-docs markdown table --output-file README.md --output-mode inject {} \; ; \
53-
fi
51+
@echo "--> Generating documentation for examples"
52+
@find . -type d -path '*/examples/*' -not -path '*.terraform*' 2>/dev/null| while read -r dir; do \
53+
echo "--> Generating documentation for example: $$dir"; \
54+
terraform-docs $$dir; \
55+
done;
5456

5557
upgrade-terraform-providers:
5658
@printf "%s Upgrading Terraform providers for %-24s" "-->" "."
@@ -59,7 +61,7 @@ upgrade-terraform-providers:
5961

6062
upgrade-terraform-example-providers:
6163
@if [ -d examples ]; then \
62-
find examples -type d -mindepth 1 -maxdepth 1 | while read -r dir; do \
64+
find examples -type d -mindepth 1 -maxdepth 1 2>/dev/null | while read -r dir; do \
6365
printf "%s Upgrading Terraform providers for %-24s" "-->" "$$dir"; \
6466
terraform -chdir=$$dir init -upgrade >/dev/null && echo "[OK]" || echo "[FAILED]"; \
6567
done; \
@@ -69,29 +71,27 @@ init:
6971
@echo "--> Running terraform init"
7072
@terraform init -backend=false
7173

72-
security:
74+
security: init
7375
@echo "--> Running Security checks"
7476
@trivy config .
7577
$(MAKE) security-modules
7678
$(MAKE) security-examples
7779

7880
security-modules:
7981
@echo "--> Running Security checks on modules"
80-
@if [ -d modules ]; then \
81-
find modules -type d -mindepth 1 -maxdepth 1 | while read -r dir; do \
82-
echo "--> Validating $$dir"; \
83-
trivy config --format table --exit-code 1 --severity CRITICAL,HIGH --ignorefile .trivyignore $$dir; \
84-
done; \
85-
fi
82+
@find . -type d -regex '.*/modules/[a-zA-Z\-_$$]*' -not -path '*.terraform*' 2>/dev/null | while read -r dir; do \
83+
echo "--> Validating $$dir"; \
84+
terraform init -backend=false; \
85+
trivy config --format table --exit-code 1 --severity CRITICAL,HIGH --ignorefile .trivyignore $$dir; \
86+
done;
8687

8788
security-examples:
8889
@echo "--> Running Security checks on examples"
89-
@if [ -d examples ]; then \
90-
find examples -type d -mindepth 1 -maxdepth 1 | while read -r dir; do \
91-
echo "--> Validating $$dir"; \
92-
trivy config --format table --exit-code 1 --severity CRITICAL,HIGH --ignorefile .trivyignore $$dir; \
93-
done; \
94-
fi
90+
@find . -type d -path '*/examples/*' -not -path '*.terraform*' 2>/dev/null | while read -r dir; do \
91+
echo "--> Validating $$dir"; \
92+
terraform init -backend=false; \
93+
trivy config --format table --exit-code 1 --severity CRITICAL,HIGH --ignorefile .trivyignore $$dir; \
94+
done;
9595

9696
tests:
9797
@echo "--> Running Terraform Tests"
@@ -103,26 +103,28 @@ validate:
103103
@terraform validate
104104
$(MAKE) validate-modules
105105
$(MAKE) validate-examples
106+
$(MAKE) validate-commits
106107

107108
validate-modules:
108109
@echo "--> Running terraform validate on modules"
109-
@if [ -d modules ]; then \
110-
find modules -type d -mindepth 1 -maxdepth 1 | while read -r dir; do \
111-
echo "--> Validating $$dir"; \
112-
terraform -chdir=$$dir init -backend=false; \
113-
terraform -chdir=$$dir validate; \
114-
done; \
115-
fi
110+
@find . -type d -regex '.*/modules/[a-zA-Z\-_$$]*' -not -path '*.terraform*' 2>/dev/null | while read -r dir; do \
111+
echo "--> Validating Module $$dir"; \
112+
terraform -chdir=$$dir init -backend=false; \
113+
terraform -chdir=$$dir validate; \
114+
done;
116115

117116
validate-examples:
118117
@echo "--> Running terraform validate on examples"
119-
@if [ -d examples ]; then \
120-
find examples -type d -mindepth 1 -maxdepth 1 | while read -r dir; do \
121-
echo "--> Validating $$dir"; \
122-
terraform -chdir=$$dir init -backend=false; \
123-
terraform -chdir=$$dir validate; \
124-
done; \
125-
fi
118+
@find . -type d -path '*/examples/*' -not -path '*.terraform*' 2>/dev/null | while read -r dir; do \
119+
echo "--> Validating $$dir"; \
120+
terraform -chdir=$$dir init -backend=false; \
121+
terraform -chdir=$$dir validate; \
122+
done;
123+
124+
validate-commits:
125+
@echo "--> Running commitlint against the main branch"
126+
@command -v commitlint >/dev/null 2>&1 || { echo "commitlint is not installed. Please install it by running 'npm install -g commitlint'"; exit 1; }
127+
@git log --pretty=format:"%s" origin/main..HEAD | commitlint --from=origin/main
126128

127129
lint:
128130
@echo "--> Running tflint"
@@ -133,31 +135,27 @@ lint:
133135

134136
lint-modules:
135137
@echo "--> Running tflint on modules"
136-
@if [ -d modules ]; then \
137-
find modules -type d -mindepth 1 -maxdepth 1 | while read -r dir; do \
138-
echo "--> Linting $$dir"; \
139-
tflint --chdir=$$dir --init; \
140-
tflint --chdir=$$dir -f compact; \
141-
done; \
142-
fi
138+
@find . -type d -regex '.*/modules/[a-zA-Z\-_$$]*' -not -path '*.terraform*' 2>/dev/null | while read -r dir; do \
139+
echo "--> Linting $$dir"; \
140+
tflint --chdir=$$dir --init; \
141+
tflint --chdir=$$dir -f compact; \
142+
done;
143143

144144
lint-examples:
145145
@echo "--> Running tflint on examples"
146-
@if [ -d examples ]; then \
147-
find examples -type d -mindepth 1 -maxdepth 1 | while read -r dir; do \
148-
echo "--> Linting $$dir"; \
149-
tflint --chdir=$$dir --init; \
150-
tflint --chdir=$$dir -f compact; \
151-
done; \
152-
fi
146+
@find . -type d -path '*/examples/*' -not -path '*.terraform*' 2>/dev/null | while read -r dir; do \
147+
echo "--> Linting $$dir"; \
148+
tflint --chdir=$$dir --init; \
149+
tflint --chdir=$$dir -f compact; \
150+
done;
153151

154152
format:
155153
@echo "--> Running terraform fmt"
156154
@terraform fmt -recursive -write=true
157155

158156
clean:
159157
@echo "--> Cleaning up"
160-
@find . -type d -name ".terraform" | while read -r dir; do \
158+
@find . -type d -name ".terraform" 2>/dev/null | while read -r dir; do \
161159
echo "--> Removing $$dir"; \
162160
rm -rf $$dir; \
163161
done

README.md

-20
Original file line numberDiff line numberDiff line change
@@ -46,32 +46,12 @@ The `terraform-docs` utility is used to generate this README. Follow the below s
4646
3. Run `terraform-docs markdown table --output-file ${PWD}/README.md --output-mode inject .`
4747

4848
<!-- BEGIN_TF_DOCS -->
49-
## Requirements
50-
51-
| Name | Version |
52-
|------|---------|
53-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.7 |
54-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0.0 |
55-
5649
## Providers
5750

5851
| Name | Version |
5952
|------|---------|
6053
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0.0 |
6154

62-
## Modules
63-
64-
| Name | Source | Version |
65-
|------|--------|---------|
66-
| <a name="module_notifications"></a> [notifications](#module\_notifications) | appvia/notifications/aws | 1.0.5 |
67-
68-
## Resources
69-
70-
| Name | Type |
71-
|------|------|
72-
| [aws_ce_anomaly_monitor.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ce_anomaly_monitor) | resource |
73-
| [aws_ce_anomaly_subscription.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ce_anomaly_subscription) | resource |
74-
7555
## Inputs
7656

7757
| Name | Description | Type | Default | Required |

examples/basic/README.md

-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,8 @@
11
<!-- BEGIN_TF_DOCS -->
2-
## Requirements
3-
4-
| Name | Version |
5-
|------|---------|
6-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
7-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0.0 |
8-
| <a name="requirement_awscc"></a> [awscc](#requirement\_awscc) | >= 0.11.0 |
9-
102
## Providers
113

124
No providers.
135

14-
## Modules
15-
16-
| Name | Source | Version |
17-
|------|--------|---------|
18-
| <a name="module_cost_anomaly_detection"></a> [cost\_anomaly\_detection](#module\_cost\_anomaly\_detection) | ../../ | n/a |
19-
20-
## Resources
21-
22-
No resources.
23-
246
## Inputs
257

268
| Name | Description | Type | Default | Required |

examples/existing_sns/README.md

-21
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,10 @@
11
<!-- BEGIN_TF_DOCS -->
2-
## Requirements
3-
4-
| Name | Version |
5-
|------|---------|
6-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
7-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0.0 |
8-
| <a name="requirement_awscc"></a> [awscc](#requirement\_awscc) | >= 0.11.0 |
9-
102
## Providers
113

124
| Name | Version |
135
|------|---------|
146
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0.0 |
157

16-
## Modules
17-
18-
| Name | Source | Version |
19-
|------|--------|---------|
20-
| <a name="module_cost_anomaly_detection"></a> [cost\_anomaly\_detection](#module\_cost\_anomaly\_detection) | ../../ | n/a |
21-
22-
## Resources
23-
24-
| Name | Type |
25-
|------|------|
26-
| [aws_secretsmanager_secret.notification](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/secretsmanager_secret) | data source |
27-
| [aws_secretsmanager_secret_version.notification](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/secretsmanager_secret_version) | data source |
28-
298
## Inputs
309

3110
| Name | Description | Type | Default | Required |

0 commit comments

Comments
 (0)