Skip to content

Commit fe7c309

Browse files
authored
feat: pre-commit autoupdate and terraform_docs (#247)
* feat: pre-commit autoupdate and terraform_docs
1 parent 8d84f1b commit fe7c309

File tree

6 files changed

+81
-37
lines changed

6 files changed

+81
-37
lines changed

.markdownlintrc

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"first-line-h1": false,
55
"line_length": false,
66
"no-multiple-blanks": false,
7-
"commands-show-output": false,
8-
"no-inline-html": false
7+
"no-inline-html": false,
8+
"no-alt-text": false
99
}

.pre-commit-config.yaml

+6-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0
3+
rev: v5.0.0
44
hooks:
55
- id: check-json
66
- id: check-merge-conflict
@@ -14,27 +14,17 @@ repos:
1414
- id: end-of-file-fixer
1515
- id: mixed-line-ending
1616

17-
- repo: https://github.com/executablebooks/mdformat
18-
rev: 0.7.16
19-
hooks:
20-
- id: mdformat
21-
additional_dependencies:
22-
- mdformat-gfm
23-
- mdformat-toc
24-
# mdformat fights with terraform_docs
25-
exclude: README.m(ark)?d(own)?
26-
2717
- repo: https://github.com/igorshubovych/markdownlint-cli
28-
rev: v0.33.0
18+
rev: v0.43.0
2919
hooks:
3020
- id: markdownlint
3121

32-
- repo: https://github.com/detailyang/pre-commit-shell
33-
rev: 1.0.5
22+
- repo: https://github.com/terraform-docs/terraform-docs
23+
rev: "v0.19.0"
3424
hooks:
35-
- id: shell-lint
25+
- id: terraform-docs-go
3626

3727
- repo: https://github.com/antonbabenko/pre-commit-terraform
38-
rev: v1.77.1
28+
rev: v1.96.3
3929
hooks:
4030
- id: terraform_fmt

.terraform-docs.yml

+31
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
1+
version: ">= 0.19.0, < 1.0.0"
2+
13
settings:
24
html: false
35
anchor: false
6+
escape: false
7+
lockfile: false
8+
hide-empty: true
49
formatter: "markdown table"
10+
11+
sort:
12+
enabled: true
13+
by: required
14+
15+
sections:
16+
show:
17+
- requirements
18+
- providers
19+
- modules
20+
- data-sources
21+
- resources
22+
- inputs
23+
- outputs
24+
25+
recursive:
26+
enabled: false
27+
include-main: false
28+
29+
output:
30+
file: README.md
31+
mode: inject
32+
template: |-
33+
<!-- BEGIN_TF_DOCS -->
34+
{{ .Content }}
35+
<!-- END_TF_DOCS -->

LICENSE renamed to LICENSE.txt

File renamed without changes.

README.md

+15-19
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ previous invocations of the module prior to upgrading the version.
3535
|------|---------|
3636
| aws | >= 3.0 |
3737

38-
## Modules
39-
40-
No modules.
41-
4238
## Resources
4339

4440
| Name | Type |
@@ -61,28 +57,28 @@ No modules.
6157

6258
| Name | Description | Type | Default | Required |
6359
|------|-------------|------|---------|:--------:|
64-
| api\_call\_rate\_insight | A measurement of write-only management API calls that occur per minute against a baseline API call volume. | `bool` | `false` | no |
65-
| api\_error\_rate\_insight | A measurement of management API calls that result in error codes. The error is shown if the API call is unsuccessful. | `bool` | `false` | no |
66-
| cloudwatch\_log\_group\_name | The name of the CloudWatch Log Group that receives CloudTrail events. | `string` | `"cloudtrail-events"` | no |
60+
| s3_bucket_name | The name of the AWS S3 bucket. | `string` | n/a | yes |
61+
| api_call_rate_insight | A measurement of write-only management API calls that occur per minute against a baseline API call volume. | `bool` | `false` | no |
62+
| api_error_rate_insight | A measurement of management API calls that result in error codes. The error is shown if the API call is unsuccessful. | `bool` | `false` | no |
63+
| cloudwatch_log_group_name | The name of the CloudWatch Log Group that receives CloudTrail events. | `string` | `"cloudtrail-events"` | no |
6764
| enabled | Enables logging for the trail. Defaults to true. Setting this to false will pause logging. | `bool` | `true` | no |
68-
| iam\_policy\_name | Name for the CloudTrail IAM policy | `string` | `"cloudtrail-cloudwatch-logs-policy"` | no |
69-
| iam\_role\_name | Name for the CloudTrail IAM role | `string` | `"cloudtrail-cloudwatch-logs-role"` | no |
70-
| key\_deletion\_window\_in\_days | Duration in days after which the key is deleted after destruction of the resource, must be 7-30 days. Default 30 days. | `string` | `30` | no |
71-
| log\_retention\_days | Number of days to keep AWS logs around in specific log group. | `string` | `90` | no |
72-
| org\_trail | Whether or not this is an organization trail. Only valid in master account. | `string` | `"false"` | no |
73-
| s3\_bucket\_name | The name of the AWS S3 bucket. | `string` | n/a | yes |
74-
| s3\_key\_prefix | S3 key prefix for CloudTrail logs | `string` | `"cloudtrail"` | no |
75-
| sns\_topic\_arn | ARN of the SNS topic for notification of log file delivery. | `string` | `""` | no |
65+
| iam_policy_name | Name for the CloudTrail IAM policy | `string` | `"cloudtrail-cloudwatch-logs-policy"` | no |
66+
| iam_role_name | Name for the CloudTrail IAM role | `string` | `"cloudtrail-cloudwatch-logs-role"` | no |
67+
| key_deletion_window_in_days | Duration in days after which the key is deleted after destruction of the resource, must be 7-30 days. Default 30 days. | `string` | `30` | no |
68+
| log_retention_days | Number of days to keep AWS logs around in specific log group. | `string` | `90` | no |
69+
| org_trail | Whether or not this is an organization trail. Only valid in master account. | `string` | `"false"` | no |
70+
| s3_key_prefix | S3 key prefix for CloudTrail logs | `string` | `"cloudtrail"` | no |
71+
| sns_topic_arn | ARN of the SNS topic for notification of log file delivery. | `string` | `""` | no |
7672
| tags | A mapping of tags to CloudTrail resources. | `map(string)` | `{}` | no |
77-
| trail\_name | Name for the Cloudtrail | `string` | `"cloudtrail"` | no |
73+
| trail_name | Name for the Cloudtrail | `string` | `"cloudtrail"` | no |
7874

7975
## Outputs
8076

8177
| Name | Description |
8278
|------|-------------|
83-
| cloudtrail\_arn | CloudTrail ARN |
84-
| cloudtrail\_home\_region | CloudTrail Home Region |
85-
| cloudtrail\_id | CloudTrail ID |
79+
| cloudtrail_arn | CloudTrail ARN |
80+
| cloudtrail_home_region | CloudTrail Home Region |
81+
| cloudtrail_id | CloudTrail ID |
8682
<!-- END_TF_DOCS -->
8783

8884
## Developer Setup

examples/simple/README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# simple
2+
3+
<!-- BEGIN_TF_DOCS -->
4+
5+
6+
## Modules
7+
8+
| Name | Source | Version |
9+
|------|--------|---------|
10+
| aws_cloudtrail | ../../ | n/a |
11+
| logs | trussworks/logs/aws | ~> 12 |
12+
13+
## Inputs
14+
15+
| Name | Description | Type | Default | Required |
16+
|------|-------------|------|---------|:--------:|
17+
| cloudwatch_log_group_name | n/a | `string` | n/a | yes |
18+
| logs_bucket | n/a | `string` | n/a | yes |
19+
| s3_key_prefix | n/a | `string` | n/a | yes |
20+
| trail_name | n/a | `string` | n/a | yes |
21+
22+
## Outputs
23+
24+
| Name | Description |
25+
|------|-------------|
26+
| cloudtrail_arn | CloudTrail ARN |
27+
<!-- END_TF_DOCS -->

0 commit comments

Comments
 (0)