From fe7c309d7e93e37864f230e980a3f3639e9ea302 Mon Sep 17 00:00:00 2001 From: Barry Morrison <689591+esacteksab@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:18:38 -0600 Subject: [PATCH] feat: pre-commit autoupdate and terraform_docs (#247) * feat: pre-commit autoupdate and terraform_docs --- .markdownlintrc | 4 ++-- .pre-commit-config.yaml | 22 ++++++---------------- .terraform-docs.yml | 31 +++++++++++++++++++++++++++++++ LICENSE => LICENSE.txt | 0 README.md | 34 +++++++++++++++------------------- examples/simple/README.md | 27 +++++++++++++++++++++++++++ 6 files changed, 81 insertions(+), 37 deletions(-) rename LICENSE => LICENSE.txt (100%) create mode 100644 examples/simple/README.md diff --git a/.markdownlintrc b/.markdownlintrc index c555be2..3e0ef98 100644 --- a/.markdownlintrc +++ b/.markdownlintrc @@ -4,6 +4,6 @@ "first-line-h1": false, "line_length": false, "no-multiple-blanks": false, - "commands-show-output": false, - "no-inline-html": false + "no-inline-html": false, + "no-alt-text": false } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bfd87bb..51f1de1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: check-json - id: check-merge-conflict @@ -14,27 +14,17 @@ repos: - id: end-of-file-fixer - id: mixed-line-ending - - repo: https://github.com/executablebooks/mdformat - rev: 0.7.16 - hooks: - - id: mdformat - additional_dependencies: - - mdformat-gfm - - mdformat-toc - # mdformat fights with terraform_docs - exclude: README.m(ark)?d(own)? - - repo: https://github.com/igorshubovych/markdownlint-cli - rev: v0.33.0 + rev: v0.43.0 hooks: - id: markdownlint - - repo: https://github.com/detailyang/pre-commit-shell - rev: 1.0.5 + - repo: https://github.com/terraform-docs/terraform-docs + rev: "v0.19.0" hooks: - - id: shell-lint + - id: terraform-docs-go - repo: https://github.com/antonbabenko/pre-commit-terraform - rev: v1.77.1 + rev: v1.96.3 hooks: - id: terraform_fmt diff --git a/.terraform-docs.yml b/.terraform-docs.yml index fb05467..39ca235 100644 --- a/.terraform-docs.yml +++ b/.terraform-docs.yml @@ -1,4 +1,35 @@ +version: ">= 0.19.0, < 1.0.0" + settings: html: false anchor: false + escape: false + lockfile: false + hide-empty: true formatter: "markdown table" + +sort: + enabled: true + by: required + +sections: + show: + - requirements + - providers + - modules + - data-sources + - resources + - inputs + - outputs + +recursive: + enabled: false + include-main: false + +output: + file: README.md + mode: inject + template: |- + + {{ .Content }} + diff --git a/LICENSE b/LICENSE.txt similarity index 100% rename from LICENSE rename to LICENSE.txt diff --git a/README.md b/README.md index 02a5866..4b1e143 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,6 @@ previous invocations of the module prior to upgrading the version. |------|---------| | aws | >= 3.0 | -## Modules - -No modules. - ## Resources | Name | Type | @@ -61,28 +57,28 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| 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 | -| 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 | -| cloudwatch\_log\_group\_name | The name of the CloudWatch Log Group that receives CloudTrail events. | `string` | `"cloudtrail-events"` | no | +| s3_bucket_name | The name of the AWS S3 bucket. | `string` | n/a | yes | +| 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 | +| 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 | +| cloudwatch_log_group_name | The name of the CloudWatch Log Group that receives CloudTrail events. | `string` | `"cloudtrail-events"` | no | | enabled | Enables logging for the trail. Defaults to true. Setting this to false will pause logging. | `bool` | `true` | no | -| iam\_policy\_name | Name for the CloudTrail IAM policy | `string` | `"cloudtrail-cloudwatch-logs-policy"` | no | -| iam\_role\_name | Name for the CloudTrail IAM role | `string` | `"cloudtrail-cloudwatch-logs-role"` | no | -| 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 | -| log\_retention\_days | Number of days to keep AWS logs around in specific log group. | `string` | `90` | no | -| org\_trail | Whether or not this is an organization trail. Only valid in master account. | `string` | `"false"` | no | -| s3\_bucket\_name | The name of the AWS S3 bucket. | `string` | n/a | yes | -| s3\_key\_prefix | S3 key prefix for CloudTrail logs | `string` | `"cloudtrail"` | no | -| sns\_topic\_arn | ARN of the SNS topic for notification of log file delivery. | `string` | `""` | no | +| iam_policy_name | Name for the CloudTrail IAM policy | `string` | `"cloudtrail-cloudwatch-logs-policy"` | no | +| iam_role_name | Name for the CloudTrail IAM role | `string` | `"cloudtrail-cloudwatch-logs-role"` | no | +| 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 | +| log_retention_days | Number of days to keep AWS logs around in specific log group. | `string` | `90` | no | +| org_trail | Whether or not this is an organization trail. Only valid in master account. | `string` | `"false"` | no | +| s3_key_prefix | S3 key prefix for CloudTrail logs | `string` | `"cloudtrail"` | no | +| sns_topic_arn | ARN of the SNS topic for notification of log file delivery. | `string` | `""` | no | | tags | A mapping of tags to CloudTrail resources. | `map(string)` | `{}` | no | -| trail\_name | Name for the Cloudtrail | `string` | `"cloudtrail"` | no | +| trail_name | Name for the Cloudtrail | `string` | `"cloudtrail"` | no | ## Outputs | Name | Description | |------|-------------| -| cloudtrail\_arn | CloudTrail ARN | -| cloudtrail\_home\_region | CloudTrail Home Region | -| cloudtrail\_id | CloudTrail ID | +| cloudtrail_arn | CloudTrail ARN | +| cloudtrail_home_region | CloudTrail Home Region | +| cloudtrail_id | CloudTrail ID | ## Developer Setup diff --git a/examples/simple/README.md b/examples/simple/README.md new file mode 100644 index 0000000..304c861 --- /dev/null +++ b/examples/simple/README.md @@ -0,0 +1,27 @@ +# simple + + + + +## Modules + +| Name | Source | Version | +|------|--------|---------| +| aws_cloudtrail | ../../ | n/a | +| logs | trussworks/logs/aws | ~> 12 | + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|------|---------|:--------:| +| cloudwatch_log_group_name | n/a | `string` | n/a | yes | +| logs_bucket | n/a | `string` | n/a | yes | +| s3_key_prefix | n/a | `string` | n/a | yes | +| trail_name | n/a | `string` | n/a | yes | + +## Outputs + +| Name | Description | +|------|-------------| +| cloudtrail_arn | CloudTrail ARN | +