Skip to content

Commit 93de799

Browse files
chore: update readme and pre-commit (#138)
* style: tfsort on variables * docs: Updating readme example to include required zone_id input * chore: remove unused variables * style: tflint * docs: update README --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 1fb638a commit 93de799

10 files changed

+75
-56
lines changed

.github/workflows/validate.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ on:
1010

1111
jobs:
1212
validate-tf:
13-
uses: trussworks/shared-actions/.github/workflows/validate-tf.yml@main
13+
uses: trussworks/shared-actions/.github/workflows/validate-tf.yml@3cab03ab95045711da37ad6d63a93c666fc22398 # v0.0.2

.markdownlintrc

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

.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-system
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 -->

README.md

+6-12
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module "acm_cert" {
1515
1616
alb_listener_arn = "arn:aws:elasticloadbalancing:us-west-2:..."
1717
domain_name = "www.example.com"
18-
zone_name = "example.com"
18+
zone_id = "ABCDEFGHIGJLK1234"
1919
}
2020
```
2121

@@ -33,10 +33,6 @@ module "acm_cert" {
3333
|------|---------|
3434
| aws | >= 3.0 |
3535

36-
## Modules
37-
38-
No modules.
39-
4036
## Resources
4137

4238
| Name | Type |
@@ -51,18 +47,16 @@ No modules.
5147

5248
| Name | Description | Type | Default | Required |
5349
|------|-------------|------|---------|:--------:|
54-
| alb\_listener\_arn | Associate ACM certificate to an ALB listener. | `string` | `""` | no |
55-
| caa\_records | Add CAA records to route53. | `list(string)` | `[]` | no |
56-
| domain\_name | Domain name to associate with the ACM certificate. | `string` | n/a | yes |
57-
| environment | Environment tag. e.g. prod | `string` | n/a | yes |
58-
| tags | Tags to be attached to the ACM certificate. | `map(string)` | `{}` | no |
59-
| zone\_id | The Route53 zone id for which the certificate should be verified and issued. | `string` | n/a | yes |
50+
| domain_name | Domain name to associate with the ACM certificate. | `string` | n/a | yes |
51+
| zone_id | The Route53 zone id for which the certificate should be verified and issued. | `string` | n/a | yes |
52+
| alb_listener_arn | Associate ACM certificate to an ALB listener. | `string` | `""` | no |
53+
| caa_records | Add CAA records to route53. | `list(string)` | `[]` | no |
6054

6155
## Outputs
6256

6357
| Name | Description |
6458
|------|-------------|
65-
| acm\_arn | The ARN of the validated ACM certificate. |
59+
| acm_arn | The ARN of the validated ACM certificate. |
6660
<!-- END_TF_DOCS -->
6761

6862
## Developer Setup

examples/simple/main.tf

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ module "acm-cert" {
77
source = "../.."
88

99
domain_name = "${var.test_name}.${local.zone_name}"
10-
environment = local.environment
11-
zone_name = local.zone_name
10+
zone_id = "abcd123456"
1211
}

main.tf

-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ resource "aws_acm_certificate" "main" {
22
domain_name = var.domain_name
33
validation_method = "DNS"
44

5-
tags = var.tags
6-
75
lifecycle {
86
create_before_destroy = true
97
}

renovate.json

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
11
{
22
"extends": [
3-
"config:base"
3+
"config:recommended",
4+
"helpers:pinGitHubActionDigests"
45
],
56
"labels": [
67
"dependencies"
78
],
89
"packageRules": [
10+
{
11+
"automerge": true,
12+
"description": "Automerge all updates except major versions",
13+
"matchUpdateTypes": [
14+
"patch",
15+
"pin",
16+
"digest",
17+
"minor"
18+
]
19+
},
920
{
1021
"description": "Tag the waddlers Github Team for major updates",
1122
"matchUpdateTypes": [
@@ -19,11 +30,14 @@
1930
"automerge": true,
2031
"description": "Group minor and patch updates into a single PR",
2132
"groupName": "dependencies",
33+
"matchManagers": [
34+
"terraform",
35+
"pre-commit",
36+
"github-actions"
37+
],
2238
"matchUpdateTypes": [
2339
"minor",
24-
"patch",
25-
"pin",
26-
"digest"
40+
"patch"
2741
]
2842
}
2943
],

variables.tf

+6-17
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,18 @@ variable "alb_listener_arn" {
44
default = ""
55
}
66

7-
variable "domain_name" {
8-
type = string
9-
description = "Domain name to associate with the ACM certificate."
7+
variable "caa_records" {
8+
description = "Add CAA records to route53."
9+
type = list(string)
10+
default = []
1011
}
1112

12-
variable "environment" {
13+
variable "domain_name" {
1314
type = string
14-
description = "Environment tag. e.g. prod"
15+
description = "Domain name to associate with the ACM certificate."
1516
}
1617

1718
variable "zone_id" {
1819
type = string
1920
description = "The Route53 zone id for which the certificate should be verified and issued."
2021
}
21-
22-
variable "caa_records" {
23-
description = "Add CAA records to route53."
24-
type = list(string)
25-
default = []
26-
}
27-
28-
variable "tags" {
29-
description = "Tags to be attached to the ACM certificate."
30-
type = map(string)
31-
default = {}
32-
}

versions.tf

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ terraform {
22
required_version = ">= 1.0"
33

44
required_providers {
5-
aws = ">= 3.0"
5+
aws = {
6+
source = "hashicorp/aws"
7+
version = ">= 3.0"
8+
}
69
}
710
}

0 commit comments

Comments
 (0)