Skip to content

Commit 537f6d4

Browse files
authored
Feature/updates (#3)
* update docs and add chglog * Add CHANGELOG.md
1 parent 466a61f commit 537f6d4

File tree

6 files changed

+230
-31
lines changed

6 files changed

+230
-31
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-elasticache-redis
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: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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 and add chglog
9+
- add git hooks and update docs
10+
- Update README.md
11+
12+
13+
<a name="1.0.2"></a>
14+
## [1.0.2] - 2020-01-03
15+
16+
- improve typing ([#1](https://github.com/umotif-public/terraform-aws-elasticache-redis/issues/1))
17+
18+
19+
<a name="1.0.1"></a>
20+
## [1.0.1] - 2019-12-20
21+
22+
- add support for custom sg and notification_topic_arn
23+
24+
25+
<a name="1.0.0"></a>
26+
## 1.0.0 - 2019-12-19
27+
28+
- add redis configuration
29+
- Initial commit of docs
30+
31+
32+
[Unreleased]: https://github.com/umotif-public/terraform-aws-elasticache-redis/compare/1.0.2...HEAD
33+
[1.0.2]: https://github.com/umotif-public/terraform-aws-elasticache-redis/compare/1.0.1...1.0.2
34+
[1.0.1]: https://github.com/umotif-public/terraform-aws-elasticache-redis/compare/1.0.0...1.0.1

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: 70 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
A Terraform module to create an AWS Redis ElastiCache cluster
44

5-
## Resources created
6-
7-
85
## Terraform versions
96

107
Terraform 0.12. Pin module version to `~> v1.0`. Submit pull-requests to `master` branch.
@@ -14,8 +11,39 @@ Terraform 0.12. Pin module version to `~> v1.0`. Submit pull-requests to `master
1411
```hcl
1512
module "redis" {
1613
source = "umotif-public/elasticache-redis/aws"
17-
version = "~> 1.0"
14+
version = "~> 1.0.0"
15+
16+
name_prefix = "core-example"
17+
number_cache_clusters = 2
18+
node_type = "cache.t3.small"
19+
20+
engine_version = "5.0.6"
21+
port = 6379
22+
maintenance_window = "mon:03:00-mon:04:00"
23+
snapshot_window = "04:00-06:00"
24+
snapshot_retention_limit = 7
25+
26+
automatic_failover_enabled = true
27+
28+
at_rest_encryption_enabled = true
29+
transit_encryption_enabled = true
30+
auth_token = "1234567890asdfghjkl"
31+
32+
apply_immediately = true
33+
family = "redis5.0"
34+
description = "Test elasticache redis."
1835
36+
subnet_ids = module.vpc.private_subnets
37+
vpc_id = module.vpc.vpc_id
38+
39+
ingress_cidr_blocks = ["0.0.0.0/0"]
40+
41+
parameter = [
42+
{
43+
name = "repl-backlog-size"
44+
value = "16384"
45+
}
46+
]
1947
2048
tags = {
2149
Project = "Test"
@@ -36,34 +64,44 @@ Module is to be used with Terraform > 0.12.
3664
Module managed by [Marcin Cuber](https://github.com/marcincuber) [linkedin](https://www.linkedin.com/in/marcincuber/).
3765

3866
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
67+
## Requirements
68+
69+
No requirements.
70+
71+
## Providers
72+
73+
| Name | Version |
74+
|------|---------|
75+
| aws | n/a |
76+
3977
## Inputs
4078

4179
| Name | Description | Type | Default | Required |
42-
|------|-------------|:----:|:-----:|:-----:|
43-
| apply\_immediately | Specifies whether any modifications are applied immediately, or during the next maintenance window. | bool | `"false"` | no |
44-
| at\_rest\_encryption\_enabled | Whether to enable encryption at rest. | bool | `"true"` | no |
45-
| auth\_token | The password used to access a password protected server. Can be specified only if `transit\_encryption\_enabled = true`. | string | `""` | no |
46-
| auto\_minor\_version\_upgrade | | string | `"true"` | no |
47-
| automatic\_failover\_enabled | Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. | bool | `"true"` | no |
48-
| description | The description of the all resources. | string | `"Managed by Terraform"` | no |
49-
| engine\_version | The version number of the cache engine to be used for the cache clusters in this replication group. | string | `"5.0.6"` | no |
50-
| family | The family of the ElastiCache parameter group. | string | `"redis5.0"` | no |
51-
| ingress\_cidr\_blocks | List of Ingress CIDR blocks. | list(string) | `[]` | no |
52-
| kms\_key\_id | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `at\_rest\_encryption\_enabled = true` | string | `""` | no |
53-
| maintenance\_window | Specifies the weekly time range for when maintenance on the cache cluster is performed. | string | `""` | no |
54-
| name\_prefix | The replication group identifier. This parameter is stored as a lowercase string. | string | n/a | yes |
55-
| node\_type | The compute and memory capacity of the nodes in the node group. | string | n/a | yes |
56-
| notification\_topic\_arn | An Amazon Resource Name \(ARN\) of an SNS topic to send ElastiCache notifications to. Example: `arn:aws:sns:us-east-1:012345678999:my\_sns\_topic` | string | `""` | no |
57-
| number\_cache\_clusters | The number of cache clusters \(primary and replicas\) this replication group will have. | number | n/a | yes |
58-
| parameter | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | object | `[]` | no |
59-
| port | The port number on which each of the cache nodes will accept connections. | number | `"6379"` | no |
60-
| security\_group\_ids | List of Security Groups. | list(string) | `[]` | no |
61-
| snapshot\_retention\_limit | The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. | number | `"30"` | no |
62-
| snapshot\_window | The daily time range \(in UTC\) during which ElastiCache will begin taking a daily snapshot of your cache cluster. | string | `""` | no |
63-
| subnet\_ids | List of VPC Subnet IDs for the cache subnet group. | list(string) | n/a | yes |
64-
| tags | A mapping of tags to assign to all resources. | map(string) | `{}` | no |
65-
| transit\_encryption\_enabled | Whether to enable encryption in transit. | bool | `"true"` | no |
66-
| vpc\_id | VPC Id to associate with Redis ElastiCache. | string | n/a | yes |
80+
|------|-------------|------|---------|:--------:|
81+
| apply\_immediately | Specifies whether any modifications are applied immediately, or during the next maintenance window. | `bool` | `false` | no |
82+
| at\_rest\_encryption\_enabled | Whether to enable encryption at rest. | `bool` | `true` | no |
83+
| auth\_token | The password used to access a password protected server. Can be specified only if `transit_encryption_enabled = true`. | `string` | `""` | no |
84+
| auto\_minor\_version\_upgrade | n/a | `string` | `true` | no |
85+
| automatic\_failover\_enabled | Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. | `bool` | `true` | no |
86+
| description | The description of the all resources. | `string` | `"Managed by Terraform"` | no |
87+
| engine\_version | The version number of the cache engine to be used for the cache clusters in this replication group. | `string` | `"5.0.6"` | no |
88+
| family | The family of the ElastiCache parameter group. | `string` | `"redis5.0"` | no |
89+
| ingress\_cidr\_blocks | List of Ingress CIDR blocks. | `list(string)` | `[]` | no |
90+
| kms\_key\_id | The ARN of the key that you wish to use if encrypting at rest. If not supplied, uses service managed encryption. Can be specified only if `at_rest_encryption_enabled = true` | `string` | `""` | no |
91+
| maintenance\_window | Specifies the weekly time range for when maintenance on the cache cluster is performed. | `string` | `""` | no |
92+
| name\_prefix | The replication group identifier. This parameter is stored as a lowercase string. | `string` | n/a | yes |
93+
| node\_type | The compute and memory capacity of the nodes in the node group. | `string` | n/a | yes |
94+
| notification\_topic\_arn | An Amazon Resource Name (ARN) of an SNS topic to send ElastiCache notifications to. Example: `arn:aws:sns:us-east-1:012345678999:my_sns_topic` | `string` | `""` | no |
95+
| number\_cache\_clusters | The number of cache clusters (primary and replicas) this replication group will have. | `number` | n/a | yes |
96+
| parameter | A list of Redis parameters to apply. Note that parameters may differ from one Redis family to another | <pre>list(object({<br> name = string<br> value = string<br> }))</pre> | `[]` | no |
97+
| port | The port number on which each of the cache nodes will accept connections. | `number` | `6379` | no |
98+
| security\_group\_ids | List of Security Groups. | `list(string)` | `[]` | no |
99+
| snapshot\_retention\_limit | The number of days for which ElastiCache will retain automatic cache cluster snapshots before deleting them. | `number` | `30` | no |
100+
| snapshot\_window | The daily time range (in UTC) during which ElastiCache will begin taking a daily snapshot of your cache cluster. | `string` | `""` | no |
101+
| subnet\_ids | List of VPC Subnet IDs for the cache subnet group. | `list(string)` | n/a | yes |
102+
| tags | A mapping of tags to assign to all resources. | `map(string)` | `{}` | no |
103+
| transit\_encryption\_enabled | Whether to enable encryption in transit. | `bool` | `true` | no |
104+
| vpc\_id | VPC Id to associate with Redis ElastiCache. | `string` | n/a | yes |
67105

68106
## Outputs
69107

@@ -101,4 +139,7 @@ See LICENSE for full details.
101139

102140
```bash
103141
brew install pre-commit terraform-docs tflint
142+
143+
brew tap git-chglog/git-chglog
144+
brew install git-chglog
104145
```

0 commit comments

Comments
 (0)