Skip to content

Commit 5c4378b

Browse files
Initial commit
0 parents  commit 5c4378b

Some content is hidden

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

41 files changed

+1164
-0
lines changed

.editorconfig

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
[*.{tf,tfvars}]
18+
indent_size = 2
19+
indent_style = space
20+
21+
[*.md]
22+
max_line_length = 0
23+
trim_trailing_whitespace = false
24+
25+
[Makefile]
26+
tab_width = 2
27+
indent_style = tab
28+
29+
[COMMIT_EDITMSG]
30+
max_line_length = 0

.github/workflows/pr-title.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 'Validate PR title'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate PR title
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Please look up the latest version from
16+
# https://github.com/amannn/action-semantic-pull-request/releases
17+
- uses: amannn/action-semantic-pull-request@v5.4.0
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
with:
21+
# Configure which types are allowed.
22+
# Default: https://github.com/commitizen/conventional-commit-types
23+
types: |
24+
fix
25+
feat
26+
docs
27+
ci
28+
chore
29+
# Configure that a scope must always be provided.
30+
requireScope: false
31+
# Configure additional validation for the subject based on a regex.
32+
# This example ensures the subject starts with an uppercase character.
33+
subjectPattern: ^[A-Z].+$
34+
# If `subjectPattern` is configured, you can use this property to override
35+
# the default error message that is shown when the pattern doesn't match.
36+
# The variables `subject` and `title` can be used within the message.
37+
subjectPatternError: |
38+
The subject "{subject}" found in the pull request title "{title}"
39+
didn't match the configured pattern. Please ensure that the subject
40+
starts with an uppercase character.
41+
# For work-in-progress PRs you can typically use draft pull requests
42+
# from Github. However, private repositories on the free plan don't have
43+
# this option and therefore this action allows you to opt-in to using the
44+
# special "[WIP]" prefix to indicate this state. This will avoid the
45+
# validation of the PR title and the pull request checks remain pending.
46+
# Note that a second check will be reported if this is enabled.
47+
wip: true
48+
# When using "Squash and merge" on a PR with only one commit, GitHub
49+
# will suggest using that commit message instead of the PR title for the
50+
# merge commit, and it's easy to commit this by mistake. Enable this option
51+
# to also validate the commit message for one commit PRs.
52+
validateSingleCommit: false

.github/workflows/release.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Module Release'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
defaults:
9+
run:
10+
shell: bash
11+
12+
jobs:
13+
release:
14+
name: Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
with:
20+
persist-credentials: false
21+
fetch-depth: 0
22+
23+
- name: Release
24+
uses: cycjimmy/semantic-release-action@v2
25+
with:
26+
semantic_version: 18.0.0
27+
extra_plugins: |
28+
@semantic-release/changelog@6.0.0
29+
@semantic-release/git@10.0.0
30+
conventional-changelog-conventionalcommits@4.6.3
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Terraform Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
env:
14+
TERRAFORM_DOCS_VERSION: v0.18.0
15+
TFLINT_VERSION: v0.52.0
16+
17+
jobs:
18+
test:
19+
name: Test
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Setup Terraform
23+
uses: hashicorp/setup-terraform@v3
24+
with:
25+
terraform_version: "1.8.4"
26+
27+
- name: Initialize Terraform
28+
id: init
29+
run: terraform init -input=false
30+
31+
- name: Terraform Test
32+
id: fmt
33+
run: terraform test
34+
35+
collectInputs:
36+
name: Collect workflow inputs
37+
needs: test
38+
runs-on: ubuntu-latest
39+
outputs:
40+
directories: ${{ steps.dirs.outputs.directories }}
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
45+
- name: Get root directories
46+
id: dirs
47+
uses: clowdhaus/terraform-composite-actions/directories@v1.9.0
48+
49+
preCommitMinVersions:
50+
name: Min TF pre-commit
51+
needs: collectInputs
52+
runs-on: ubuntu-latest
53+
strategy:
54+
matrix:
55+
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
56+
steps:
57+
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
58+
- name: Delete huge unnecessary tools folder
59+
run: |
60+
rm -rf /opt/hostedtoolcache/CodeQL
61+
rm -rf /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk
62+
rm -rf /opt/hostedtoolcache/Ruby
63+
rm -rf /opt/hostedtoolcache/go
64+
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
68+
- name: Terraform min/max versions
69+
id: minMax
70+
uses: clowdhaus/terraform-min-max@v1.3.0
71+
with:
72+
directory: ${{ matrix.directory }}
73+
74+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
75+
# Run only validate pre-commit check on min version supported
76+
if: ${{ matrix.directory != '.' }}
77+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
78+
with:
79+
terraform-version: ${{ steps.minMax.outputs.minVersion }}
80+
tflint-version: ${{ env.TFLINT_VERSION }}
81+
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'
82+
83+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
84+
# Run only validate pre-commit check on min version supported
85+
if: ${{ matrix.directory == '.' }}
86+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
87+
with:
88+
terraform-version: ${{ steps.minMax.outputs.minVersion }}
89+
tflint-version: ${{ env.TFLINT_VERSION }}
90+
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'
91+
92+
preCommitMaxVersion:
93+
name: Max TF pre-commit
94+
runs-on: ubuntu-latest
95+
needs: collectInputs
96+
steps:
97+
# https://github.com/orgs/community/discussions/25678#discussioncomment-5242449
98+
- name: Delete huge unnecessary tools folder
99+
run: |
100+
rm -rf /opt/hostedtoolcache/CodeQL
101+
rm -rf /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk
102+
rm -rf /opt/hostedtoolcache/Ruby
103+
rm -rf /opt/hostedtoolcache/go
104+
105+
- name: Checkout
106+
uses: actions/checkout@v4
107+
with:
108+
ref: ${{ github.event.pull_request.head.ref }}
109+
repository: ${{github.event.pull_request.head.repo.full_name}}
110+
111+
- name: Terraform min/max versions
112+
id: minMax
113+
uses: clowdhaus/terraform-min-max@v1.3.0
114+
115+
- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
116+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0
117+
with:
118+
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
119+
tflint-version: ${{ env.TFLINT_VERSION }}
120+
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}
121+
install-hcledit: true
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Terraform Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
env:
14+
TERRAFORM_DOCS_VERSION: v0.18.0
15+
16+
jobs:
17+
generateDocs:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.event.pull_request.head.ref }}
24+
25+
- name: Render and Push terraform docs for main and modules
26+
uses: terraform-docs/gh-actions@main
27+
with:
28+
working-dir: .
29+
git-push: true
30+
config-file: .terraform-docs.yaml
31+
32+
- name: Render and Push terraform docs for examples
33+
uses: terraform-docs/gh-actions@main
34+
with:
35+
working-dir: .
36+
git-push: true
37+
config-file: .terraform-docs-example.yaml

.gitignore

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
build/
2+
plan.out
3+
plan.out.json
4+
5+
# Local .terraform directories
6+
.terraform/
7+
8+
# .tfstate files
9+
*.tfstate
10+
*.tfstate.*
11+
12+
# Crash log files
13+
crash.log
14+
15+
# Exclude all .tfvars files, which are likely to contain sentitive data, such as
16+
# password, private keys, and other secrets. These should not be part of version
17+
# control as they are data points which are potentially sensitive and subject
18+
# to change depending on the environment.
19+
#
20+
*.tfvars
21+
22+
# Ignore override files as they are usually used to override resources locally and so
23+
# are not checked in
24+
override.tf
25+
override.tf.json
26+
*_override.tf
27+
*_override.tf.json
28+
29+
# Include override files you do wish to add to version control using negated pattern
30+
#
31+
# !example_override.tf
32+
33+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
34+
# example: *tfplan*
35+
36+
# Ignore CLI configuration files
37+
.terraformrc
38+
terraform.rc
39+
**/.terraform.lock.hcl
40+
41+
go.mod
42+
go.sum
43+
44+
.DS_Store

0 commit comments

Comments
 (0)