Skip to content
This repository was archived by the owner on Jul 25, 2023. It is now read-only.

Commit 1b16d7b

Browse files
authored
Feature/updates (#1)
* update docs and add chglog * Add CHANGELOG.md
1 parent f7f46b9 commit 1b16d7b

File tree

6 files changed

+182
-26
lines changed

6 files changed

+182
-26
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-ecs-fargate-scheduled-task
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.27.0
21+
rev: v1.29.0
2222
hooks:
2323
- id: terraform_fmt
2424
- id: terraform_docs

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
10+
11+
<a name="1.0.0"></a>
12+
## 1.0.0 - 2020-03-10
13+
14+
- update docs and examples
15+
- Add terraform module configuration
16+
- Initial commit
17+
18+
19+
[Unreleased]: https://github.com/umotif-public/terraform-aws-ecs-fargate-scheduled-task/compare/1.0.0...HEAD

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: 37 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,41 +38,51 @@ Module is to be used with Terraform > 0.12.
3838
Module managed by [Marcin Cuber](https://github.com/marcincuber) [LinkedIn](https://www.linkedin.com/in/marcincuber/).
3939

4040
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
41+
## Requirements
42+
43+
No requirements.
44+
45+
## Providers
46+
47+
| Name | Version |
48+
|------|---------|
49+
| aws | n/a |
50+
4151
## Inputs
4252

4353
| Name | Description | Type | Default | Required |
44-
|------|-------------|:----:|:-----:|:-----:|
45-
| ecs\_cluster\_arn | The ECS Cluster where the scheduled task will be running | string | n/a | yes |
46-
| event\_rule\_description | The description of the rule. | string | `"null"` | no |
47-
| event\_rule\_event\_pattern | \(Required, if schedule\_expression isn't specified\) Event pattern described a JSON object. See full documentation of CloudWatch Events and Event Patterns for details. | string | `"null"` | no |
48-
| event\_rule\_is\_enabled | Whether the rule should be enabled. | bool | `"true"` | no |
49-
| event\_rule\_name | The rule's name. | string | `""` | no |
50-
| event\_rule\_role\_arn | The Amazon Resource Name \(ARN\) associated with the role that is used for target invocation. | string | `"null"` | no |
51-
| event\_rule\_schedule\_expression | \(Required, if event\_pattern isn't specified\) The scheduling expression. For example, cron\(0 20 \* \* ? \*\) or rate\(5 minutes\). | string | `"null"` | no |
52-
| event\_target\_assign\_public\_ip | Assign a public IP address to the ENI \(Fargate launch type only\). Valid values are true or false. Default false. | bool | `"false"` | no |
53-
| event\_target\_group | Specifies an ECS task group for the task. The maximum length is 255 characters. | string | `"null"` | no |
54-
| event\_target\_id | The unique target assignment ID. If missing, will generate a random, unique id. | string | `"null"` | no |
55-
| event\_target\_input | Valid JSON text passed to the target. | string | `"null"` | no |
56-
| event\_target\_input\_path | The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. | string | `"null"` | no |
57-
| event\_target\_platform\_version | Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0. This is used only if LaunchType is FARGATE. For more information about valid platform versions, see AWS Fargate Platform Versions. Default to LATEST | string | `"LATEST"` | no |
58-
| event\_target\_security\_groups | The security groups associated with the task or service. If you do not specify a security group, the default security group for the VPC is used. | list | `[]` | no |
59-
| event\_target\_subnets | The subnets associated with the task or service. | list | n/a | yes |
60-
| event\_target\_task\_count | The number of tasks to create based on the TaskDefinition. The default is 1. | number | `"1"` | no |
61-
| event\_target\_task\_definition\_arn | The ARN of the task definition to use if the event target is an Amazon ECS cluster. | string | n/a | yes |
62-
| execution\_role\_arn | ARN of IAM Role for task execution \(see: https://docs.aws.amazon.com/ja\_jp/AmazonECS/latest/developerguide/task\_execution\_IAM\_role.html \) | string | `""` | no |
63-
| name\_prefix | Name prefix for resources on AWS. | string | n/a | yes |
64-
| tags | A map of tags \(key-value pairs\) passed to resources. | map(string) | `{}` | no |
65-
| task\_role\_arn | ARN of IAM Role for task \(see: https://docs.aws.amazon.com/ja\_jp/AmazonECS/latest/developerguide/task-iam-roles.html \) | string | n/a | yes |
54+
|------|-------------|------|---------|:--------:|
55+
| ecs\_cluster\_arn | The ECS Cluster where the scheduled task will be running | `any` | n/a | yes |
56+
| event\_rule\_description | The description of the rule. | `any` | `null` | no |
57+
| event\_rule\_event\_pattern | (Required, if schedule\_expression isn't specified) Event pattern described a JSON object. See full documentation of CloudWatch Events and Event Patterns for details. | `any` | `null` | no |
58+
| event\_rule\_is\_enabled | Whether the rule should be enabled. | `bool` | `true` | no |
59+
| event\_rule\_name | The rule's name. | `string` | `""` | no |
60+
| event\_rule\_role\_arn | The Amazon Resource Name (ARN) associated with the role that is used for target invocation. | `any` | `null` | no |
61+
| event\_rule\_schedule\_expression | (Required, if event\_pattern isn't specified) The scheduling expression. For example, cron(0 20 \* \* ? \*) or rate(5 minutes). | `any` | `null` | no |
62+
| event\_target\_assign\_public\_ip | Assign a public IP address to the ENI (Fargate launch type only). Valid values are true or false. Default false. | `bool` | `false` | no |
63+
| event\_target\_group | Specifies an ECS task group for the task. The maximum length is 255 characters. | `any` | `null` | no |
64+
| event\_target\_id | The unique target assignment ID. If missing, will generate a random, unique id. | `any` | `null` | no |
65+
| event\_target\_input | Valid JSON text passed to the target. | `any` | `null` | no |
66+
| event\_target\_input\_path | The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. | `any` | `null` | no |
67+
| event\_target\_platform\_version | Specifies the platform version for the task. Specify only the numeric portion of the platform version, such as 1.1.0. This is used only if LaunchType is FARGATE. For more information about valid platform versions, see AWS Fargate Platform Versions. Default to LATEST | `string` | `"LATEST"` | no |
68+
| event\_target\_security\_groups | The security groups associated with the task or service. If you do not specify a security group, the default security group for the VPC is used. | `list` | `[]` | no |
69+
| event\_target\_subnets | The subnets associated with the task or service. | `list` | n/a | yes |
70+
| event\_target\_task\_count | The number of tasks to create based on the TaskDefinition. The default is 1. | `number` | `1` | no |
71+
| event\_target\_task\_definition\_arn | The ARN of the task definition to use if the event target is an Amazon ECS cluster. | `any` | n/a | yes |
72+
| execution\_role\_arn | ARN of IAM Role for task execution (see: https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/developerguide/task_execution_IAM_role.html ) | `string` | `""` | no |
73+
| name\_prefix | Name prefix for resources on AWS. | `any` | n/a | yes |
74+
| tags | A map of tags (key-value pairs) passed to resources. | `map(string)` | `{}` | no |
75+
| task\_role\_arn | ARN of IAM Role for task (see: https://docs.aws.amazon.com/ja_jp/AmazonECS/latest/developerguide/task-iam-roles.html ) | `any` | n/a | yes |
6676

6777
## Outputs
6878

6979
| Name | Description |
7080
|------|-------------|
71-
| aws\_cloudwatch\_event\_rule\_event\_rule\_arn | The Amazon Resource Name \(ARN\) of the CloudWatch Event Rule. |
81+
| aws\_cloudwatch\_event\_rule\_event\_rule\_arn | The Amazon Resource Name (ARN) of the CloudWatch Event Rule. |
7282
| aws\_iam\_role\_policy\_id | The role policy ID, in the form of role\_name:role\_policy\_name. |
7383
| aws\_iam\_role\_policy\_name | The name of the policy. |
7484
| aws\_iam\_role\_policy\_role | The name of the role associated with the policy. |
75-
| event\_role\_arn | The Amazon Resource Name \(ARN\) specifying the role. |
85+
| event\_role\_arn | The Amazon Resource Name (ARN) specifying the role. |
7686
| event\_role\_create\_date | The creation date of the IAM role. |
7787
| event\_role\_description | The description of the role. |
7888
| event\_role\_id | The name of the role. |
@@ -97,4 +107,7 @@ See LICENSE for full details.
97107

98108
```bash
99109
brew install pre-commit terraform-docs tflint
110+
111+
brew tap git-chglog/git-chglog
112+
brew install git-chglog
100113
```

0 commit comments

Comments
 (0)