Skip to content

Commit 48eeb94

Browse files
authored
feat: first commit (terraform-aws-modules#1)
1 parent da1b381 commit 48eeb94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2733
-1
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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
style: github
3+
template: CHANGELOG.tpl.md
4+
info:
5+
title: CHANGELOG
6+
repository_url: https://github.com/svenlito/terraform-aws-eventbridge
7+
options:
8+
header:
9+
pattern: "^(.*)$"
10+
pattern_maps:
11+
- Subject

.editorconfig

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
# Uses editorconfig to maintain consistent coding styles
3+
4+
# top-most EditorConfig file
5+
root = true
6+
7+
# Unix-style newlines with a newline ending every file
8+
[*]
9+
charset = utf-8
10+
end_of_line = lf
11+
indent_size = 2
12+
indent_style = space
13+
insert_final_newline = true
14+
max_line_length = 80
15+
trim_trailing_whitespace = true
16+
17+
[*.{hcl}]
18+
indent_size = 2
19+
indent_style = space
20+
21+
[*.md]
22+
max_line_length = 0
23+
trim_trailing_whitespace = false
24+
25+
# Tab indentation (no size specified)
26+
[Makefile]
27+
tab_width = 2
28+
indent_style = tab
29+
30+
# Don't wrap lines for Git commit messages
31+
[COMMIT_EDITMSG]
32+
max_line_length = 0

.github/workflows/pre-commit.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
name: Pre-Commit
3+
4+
on:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
# Min Terraform version(s)
12+
getDirectories:
13+
name: Get root directories
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v2
18+
- name: Install Python
19+
uses: actions/setup-python@v2
20+
- name: Build matrix
21+
id: matrix
22+
run: |
23+
DIRS=$(python -c "import json; import glob; print(json.dumps([x.replace('/versions.tf', '') for x in glob.glob('./**/versions.tf', recursive=True)]))")
24+
echo "::set-output name=directories::$DIRS"
25+
outputs:
26+
directories: ${{ steps.matrix.outputs.directories }}
27+
28+
preCommitMinVersions:
29+
name: Min TF validate
30+
needs: getDirectories
31+
runs-on: ubuntu-latest
32+
strategy:
33+
matrix:
34+
directory: ${{ fromJson(needs.getDirectories.outputs.directories) }}
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
- name: Install Python
39+
uses: actions/setup-python@v2
40+
- name: Terraform min/max versions
41+
id: minMax
42+
uses: clowdhaus/[email protected]
43+
with:
44+
directory: ${{ matrix.directory }}
45+
- name: Install Terraform v${{ steps.minMax.outputs.minVersion }}
46+
uses: hashicorp/setup-terraform@v1
47+
with:
48+
terraform_version: ${{ steps.minMax.outputs.minVersion }}
49+
- name: Install pre-commit dependencies
50+
run: pip install pre-commit
51+
- name: Execute pre-commit
52+
# Run only validate pre-commit check on min version supported
53+
if: ${{ matrix.directory != '.' }}
54+
run:
55+
pre-commit run terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*
56+
- name: Execute pre-commit
57+
# Run only validate pre-commit check on min version supported
58+
if: ${{ matrix.directory == '.' }}
59+
run:
60+
pre-commit run terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)
61+
62+
# Max Terraform version
63+
getBaseVersion:
64+
name: Module max TF version
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v2
69+
- name: Terraform min/max versions
70+
id: minMax
71+
uses: clowdhaus/[email protected]
72+
outputs:
73+
minVersion: ${{ steps.minMax.outputs.minVersion }}
74+
maxVersion: ${{ steps.minMax.outputs.maxVersion }}
75+
76+
preCommitMaxVersion:
77+
name: Max TF pre-commit
78+
runs-on: ubuntu-latest
79+
needs: getBaseVersion
80+
strategy:
81+
fail-fast: false
82+
matrix:
83+
version:
84+
- ${{ needs.getBaseVersion.outputs.maxVersion }}
85+
steps:
86+
- name: Checkout
87+
uses: actions/checkout@v2
88+
- name: Install Python
89+
uses: actions/setup-python@v2
90+
- name: Install Terraform v${{ matrix.version }}
91+
uses: hashicorp/setup-terraform@v1
92+
with:
93+
terraform_version: ${{ matrix.version }}
94+
- name: Install pre-commit dependencies
95+
run: |
96+
pip install pre-commit
97+
curl -L "$(curl -s https://api.github.com/repos/terraform-docs/terraform-docs/releases/latest | grep -o -E "https://.+?-linux-amd64" | head -n1)" > terraform-docs && chmod +x terraform-docs && sudo mv terraform-docs /usr/bin/
98+
curl -L "$(curl -s https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" > tflint.zip && unzip tflint.zip && rm tflint.zip && sudo mv tflint /usr/bin/
99+
- name: Execute pre-commit
100+
# Run all pre-commit checks on max version supported
101+
if: ${{ matrix.version == needs.getBaseVersion.outputs.maxVersion }}
102+
run: pre-commit run --color=always --show-diff-on-failure --all-files

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.DS_Store
2+
3+
# Local .terraform directories
4+
**/.terraform/*
5+
6+
# Terraform lockfile
7+
.terraform.lock.hcl
8+
9+
# .tfstate files
10+
*.tfstate
11+
*.tfstate.*
12+
*.tfplan
13+
14+
# Crash log files
15+
crash.log
16+
17+
# Exclude all .tfvars files, which are likely to contain sentitive data, such as
18+
# password, private keys, and other secrets. These should not be part of version
19+
# control as they are data points which are potentially sensitive and subject
20+
# to change depending on the environment.
21+
*.tfvars
22+
23+
# Ignore override files as they are usually used to override resources locally and so
24+
# are not checked in
25+
override.tf
26+
override.tf.json
27+
*_override.tf
28+
*_override.tf.json
29+
30+
# Ignore CLI configuration files
31+
.terraformrc
32+
terraform.rc

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
repos:
3+
- repo: git://github.com/antonbabenko/pre-commit-terraform
4+
rev: v1.48.0
5+
hooks:
6+
- id: terraform_fmt
7+
- id: terraform_validate
8+
- id: terraform_docs
9+
- id: terraform_tflint
10+
args:
11+
- '--args=--only=terraform_deprecated_interpolation'
12+
- '--args=--only=terraform_deprecated_index'
13+
- '--args=--only=terraform_unused_declarations'
14+
- '--args=--only=terraform_comment_syntax'
15+
- '--args=--only=terraform_documented_outputs'
16+
- '--args=--only=terraform_documented_variables'
17+
- '--args=--only=terraform_typed_variables'
18+
- '--args=--only=terraform_module_pinned_source'
19+
- '--args=--only=terraform_naming_convention'
20+
- '--args=--only=terraform_required_version'
21+
- '--args=--only=terraform_required_providers'
22+
- '--args=--only=terraform_standard_module_structure'
23+
- '--args=--only=terraform_workspace_remote'
24+
- repo: git://github.com/pre-commit/pre-commit-hooks
25+
rev: v3.4.0
26+
hooks:
27+
- id: check-merge-conflict

CHANGELOG.md

Whitespace-only changes.

LICENSE

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2021 Sven Lito
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.PHONY: changelog release
2+
3+
changelog:
4+
git-chglog -o CHANGELOG.md --next-tag `semtag final -s minor -o`
5+
6+
release:
7+
semtag final -s minor

0 commit comments

Comments
 (0)