Skip to content

Commit 0c22da0

Browse files
authored
Feature/updates (#2)
* Update docs + lock versions and add changelog * Update changelog * update hooks
1 parent 4cd062b commit 0c22da0

File tree

7 files changed

+212
-25
lines changed

7 files changed

+212
-25
lines changed

.chglog/CHANGELOG.tpl.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
{{ if .Versions -}}
6+
<a name="unreleased"></a>
7+
## [Unreleased]
8+
{{ if .Unreleased.CommitGroups -}}
9+
{{ range .Unreleased.CommitGroups -}}
10+
### {{ .Title }}
11+
{{ range .Commits -}}
12+
{{/* SKIPPING RULES - START */ -}}
13+
{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}}
14+
{{- if not (contains .Subject "[ci skip]") -}}
15+
{{- if not (contains .Subject "[skip ci]") -}}
16+
{{- if not (hasPrefix .Subject "Merge pull request ") -}}
17+
{{- if not (hasPrefix .Subject "Added CHANGELOG") -}}
18+
{{- /* SKIPPING RULES - END */ -}}
19+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
20+
{{/* SKIPPING RULES - START */ -}}
21+
{{ end -}}
22+
{{ end -}}
23+
{{ end -}}
24+
{{ end -}}
25+
{{ end -}}
26+
{{/* SKIPPING RULES - END */ -}}
27+
{{ end }}
28+
{{ end -}}
29+
{{ else }}
30+
{{ range .Unreleased.Commits -}}
31+
{{/* SKIPPING RULES - START */ -}}
32+
{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}}
33+
{{- if not (contains .Subject "[ci skip]") -}}
34+
{{- if not (contains .Subject "[skip ci]") -}}
35+
{{- if not (hasPrefix .Subject "Merge pull request ") -}}
36+
{{- if not (hasPrefix .Subject "Added CHANGELOG") -}}
37+
{{- /* SKIPPING RULES - END */ -}}
38+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
39+
{{/* SKIPPING RULES - START */ -}}
40+
{{ end -}}
41+
{{ end -}}
42+
{{ end -}}
43+
{{ end -}}
44+
{{ end -}}
45+
{{/* SKIPPING RULES - END */ -}}
46+
{{ end }}
47+
{{ end -}}
48+
{{ end -}}
49+
50+
{{ range .Versions }}
51+
<a name="{{ .Tag.Name }}"></a>
52+
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
53+
{{ if .CommitGroups -}}
54+
{{ range .CommitGroups -}}
55+
### {{ .Title }}
56+
{{ range .Commits -}}
57+
{{/* SKIPPING RULES - START */ -}}
58+
{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}}
59+
{{- if not (contains .Subject "[ci skip]") -}}
60+
{{- if not (contains .Subject "[skip ci]") -}}
61+
{{- if not (hasPrefix .Subject "Merge pull request ") -}}
62+
{{- if not (hasPrefix .Subject "Added CHANGELOG") -}}
63+
{{- /* SKIPPING RULES - END */ -}}
64+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
65+
{{/* SKIPPING RULES - START */ -}}
66+
{{ end -}}
67+
{{ end -}}
68+
{{ end -}}
69+
{{ end -}}
70+
{{ end -}}
71+
{{/* SKIPPING RULES - END */ -}}
72+
{{ end }}
73+
{{ end -}}
74+
{{ else }}
75+
{{ range .Commits -}}
76+
{{/* SKIPPING RULES - START */ -}}
77+
{{- if not (hasPrefix .Subject "Updated CHANGELOG") -}}
78+
{{- if not (contains .Subject "[ci skip]") -}}
79+
{{- if not (contains .Subject "[skip ci]") -}}
80+
{{- if not (hasPrefix .Subject "Merge pull request ") -}}
81+
{{- if not (hasPrefix .Subject "Added CHANGELOG") -}}
82+
{{- /* SKIPPING RULES - END */ -}}
83+
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
84+
{{/* SKIPPING RULES - START */ -}}
85+
{{ end -}}
86+
{{ end -}}
87+
{{ end -}}
88+
{{ end -}}
89+
{{ end -}}
90+
{{/* SKIPPING RULES - END */ -}}
91+
{{ end }}
92+
{{ end -}}
93+
94+
{{- if .NoteGroups -}}
95+
{{ range .NoteGroups -}}
96+
### {{ .Title }}
97+
{{ range .Notes }}
98+
{{ .Body }}
99+
{{ end }}
100+
{{ end -}}
101+
{{ end -}}
102+
{{ end -}}
103+
104+
{{- if .Versions }}
105+
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
106+
{{ range .Versions -}}
107+
{{ if .Tag.Previous -}}
108+
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
109+
{{ end -}}
110+
{{ end -}}
111+
{{ end -}}

.chglog/config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
style: github
2+
template: CHANGELOG.tpl.md
3+
info:
4+
title: CHANGELOG
5+
repository_url: https://github.com/umotif-public/terraform-aws-alb
6+
options:
7+
header:
8+
pattern: "^(.*)$"
9+
pattern_maps:
10+
- Subject

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
args: ['--allow-missing-credentials']
1919
- id: trailing-whitespace
2020
- repo: git://github.com/antonbabenko/pre-commit-terraform
21-
rev: v1.25.0
21+
rev: v1.29.0
2222
hooks:
2323
- id: terraform_fmt
2424
- id: terraform_docs

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Change Log
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
<a name="unreleased"></a>
6+
## [Unreleased]
7+
8+
- Update docs + lock versions and add changelog
9+
- add git hooks and update docs
10+
- update docs
11+
12+
13+
<a name="1.1.0"></a>
14+
## [1.1.0] - 2019-12-20
15+
16+
- fix sg issues and add redirect 443 ingres
17+
18+
19+
<a name="1.0.4"></a>
20+
## [1.0.4] - 2019-12-19
21+
22+
- add docs generation and update README
23+
24+
25+
<a name="1.0.3"></a>
26+
## [1.0.3] - 2019-12-17
27+
28+
- Add default security group ingress when redirect is enabled
29+
30+
31+
<a name="1.0.2"></a>
32+
## 1.0.2 - 2019-12-12
33+
34+
- Add default redirect and nlb example
35+
36+
37+
[Unreleased]: https://github.com/umotif-public/terraform-aws-alb/compare/1.1.0...HEAD
38+
[1.1.0]: https://github.com/umotif-public/terraform-aws-alb/compare/1.0.4...1.1.0
39+
[1.0.4]: https://github.com/umotif-public/terraform-aws-alb/compare/1.0.3...1.0.4
40+
[1.0.3]: https://github.com/umotif-public/terraform-aws-alb/compare/1.0.2...1.0.3

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ifneq (,)
22
.error This Makefile requires GNU Make.
33
endif
44

5-
.PHONY: hooks validate
5+
.PHONY: hooks validate changelog
66

77
help:
88
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@@ -14,3 +14,6 @@ hooks: ## Commit hooks setup
1414

1515
validate: ## Validate files with pre-commit hooks
1616
@pre-commit run --all-files
17+
18+
changelog:
19+
git-chglog -o CHANGELOG.md

README.md

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Terraform 0.12. Pin module version to `~> v1.0`. Submit pull-requests to `master
1818
```hcl
1919
module "alb" {
2020
source = "umotif-public/alb/aws"
21-
version = "~> 1.0"
21+
version = "~> 1.2.0"
2222
2323
name_prefix = "complete-alb"
2424
@@ -43,7 +43,7 @@ module "alb" {
4343
```hcl
4444
module "nlb" {
4545
source = "umotif-public/alb/aws"
46-
version = "~> 1.0"
46+
version = "~> 1.2.0"
4747
4848
name = "complete-nlb"
4949
@@ -76,29 +76,42 @@ Module is to be used with Terraform > 0.12.
7676
Module managed by [Marcin Cuber](https://github.com/marcincuber) [linkedin](https://www.linkedin.com/in/marcincuber/).
7777

7878
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
79+
## Requirements
80+
81+
| Name | Version |
82+
|------|---------|
83+
| terraform | ~> 0.12.6 |
84+
| aws | ~> 2.45 |
85+
86+
## Providers
87+
88+
| Name | Version |
89+
|------|---------|
90+
| aws | ~> 2.45 |
91+
7992
## Inputs
8093

8194
| Name | Description | Type | Default | Required |
82-
|------|-------------|:----:|:-----:|:-----:|
83-
| access\_logs | An Access Logs block. | map(string) | `{}` | no |
84-
| cidr\_blocks\_redirect | List of CIDR ranges to allow at security group level. Defaults to 0.0.0.0/0 | list(string) | `[ "0.0.0.0/0" ]` | no |
85-
| description | The description of the all resources. | string | `"Managed by Terraform"` | no |
86-
| enable\_cross\_zone\_load\_balancing | If true, cross-zone load balancing of the load balancer will be enabled. This is a network load balancer feature. | bool | `"false"` | no |
87-
| enable\_deletion\_protection | If true, deletion of the load balancer will be disabled via the AWS API. This will prevent Terraform from deleting the load balancer. | bool | `"false"` | no |
88-
| enable\_http2 | Indicates whether HTTP/2 is enabled in application load balancers. | bool | `"true"` | no |
89-
| enable\_http\_to\_https\_redirect | Enable default redirect rule from port 80 to 443. | bool | `"false"` | no |
90-
| idle\_timeout | \(Optional\) The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type application. | number | `"60"` | no |
91-
| internal | Provision an internal load balancer. Defaults to false. | bool | `"false"` | no |
92-
| ip\_address\_type | The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack. | string | `"ipv4"` | no |
93-
| load\_balancer\_create\_timeout | Timeout value when creating the ALB. | string | `"15m"` | no |
94-
| load\_balancer\_delete\_timeout | Timeout value when deleting the ALB. | string | `"15m"` | no |
95-
| load\_balancer\_type | Type of load balancer to provision \(network or application\). | string | `"application"` | no |
96-
| load\_balancer\_update\_timeout | Timeout value when updating the ALB. | string | `"15m"` | no |
97-
| name\_prefix | A prefix used for naming resources. | string | n/a | yes |
98-
| subnet\_mapping | A list of subnet mapping blocks describing subnets to attach to network load balancer | list(map(string)) | `[]` | no |
99-
| subnets | A list of subnet IDs to attach to the LB. | list(string) | n/a | yes |
100-
| tags | A map of tags \(key-value pairs\) passed to resources. | map(string) | `{}` | no |
101-
| vpc\_id | The VPC ID. | string | n/a | yes |
95+
|------|-------------|------|---------|:--------:|
96+
| access\_logs | An Access Logs block. | `map(string)` | `{}` | no |
97+
| cidr\_blocks\_redirect | List of CIDR ranges to allow at security group level. Defaults to 0.0.0.0/0 | `list(string)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |
98+
| description | The description of the all resources. | `string` | `"Managed by Terraform"` | no |
99+
| enable\_cross\_zone\_load\_balancing | If true, cross-zone load balancing of the load balancer will be enabled. This is a network load balancer feature. | `bool` | `false` | no |
100+
| enable\_deletion\_protection | If true, deletion of the load balancer will be disabled via the AWS API. This will prevent Terraform from deleting the load balancer. | `bool` | `false` | no |
101+
| enable\_http2 | Indicates whether HTTP/2 is enabled in application load balancers. | `bool` | `true` | no |
102+
| enable\_http\_to\_https\_redirect | Enable default redirect rule from port 80 to 443. | `bool` | `false` | no |
103+
| idle\_timeout | (Optional) The time in seconds that the connection is allowed to be idle. Only valid for Load Balancers of type application. | `number` | `60` | no |
104+
| internal | Provision an internal load balancer. Defaults to false. | `bool` | `false` | no |
105+
| ip\_address\_type | The type of IP addresses used by the subnets for your load balancer. The possible values are ipv4 and dualstack. | `string` | `"ipv4"` | no |
106+
| load\_balancer\_create\_timeout | Timeout value when creating the ALB. | `string` | `"15m"` | no |
107+
| load\_balancer\_delete\_timeout | Timeout value when deleting the ALB. | `string` | `"15m"` | no |
108+
| load\_balancer\_type | Type of load balancer to provision (network or application). | `string` | `"application"` | no |
109+
| load\_balancer\_update\_timeout | Timeout value when updating the ALB. | `string` | `"15m"` | no |
110+
| name\_prefix | A prefix used for naming resources. | `string` | n/a | yes |
111+
| subnet\_mapping | A list of subnet mapping blocks describing subnets to attach to network load balancer | `list(map(string))` | `[]` | no |
112+
| subnets | A list of subnet IDs to attach to the LB. | `list(string)` | n/a | yes |
113+
| tags | A map of tags (key-value pairs) passed to resources. | `map(string)` | `{}` | no |
114+
| vpc\_id | The VPC ID. | `string` | n/a | yes |
102115

103116
## Outputs
104117

@@ -110,7 +123,7 @@ Module managed by [Marcin Cuber](https://github.com/marcincuber) [linkedin](http
110123
| name | The name of the load balancer. |
111124
| origin\_id | First part of the DNS name of the load balancer. |
112125
| security\_group\_id | The ID of the security group. |
113-
| zone\_id | The canonical hosted zone ID of the load balancer \(to be used in a Route 53 Alias record\). |
126+
| zone\_id | The canonical hosted zone ID of the load balancer (to be used in a Route 53 Alias record). |
114127

115128
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
116129

@@ -130,5 +143,8 @@ See LICENSE for full details.
130143

131144
```bash
132145
brew install pre-commit terraform-docs tflint
146+
147+
brew tap git-chglog/git-chglog
148+
brew install git-chglog
133149
```
134150

versions.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
terraform {
2+
required_version = "~> 0.12.6"
3+
4+
required_providers {
5+
aws = "~> 2.45"
6+
}
7+
}

0 commit comments

Comments
 (0)