generated from asyrafnorafandi/terraform-modules-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d4e8971
Showing
22 changed files
with
511 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
# Override for Makefile | ||
[{Makefile,makefile,GNUmakefile}] | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[Makefile.*] | ||
indent_style = tab | ||
indent_size = 4 | ||
|
||
[{*.yaml,*.yml,*.md}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.sh] | ||
indent_style = tab | ||
indent_size = 2 | ||
|
||
[*.{tf,tfvars,tpl,variant}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.json] | ||
insert_final_newline = false |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This is a comment. | ||
# Each line is a file pattern followed by one or more owners. | ||
|
||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence, | ||
# @global-owner1 and @global-owner2 will be requested for | ||
# review when someone opens a pull request. | ||
* [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# These are supported funding model platforms | ||
--- | ||
github: asyrafnorafandi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Bug Report | ||
description: File a bug report | ||
labels: ["triage"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thanks for reporting a bug 🐛! | ||
Please search open/closed issues before submitting. Someone might have had the similar problem before 😉! | ||
- type: textarea | ||
id: description | ||
attributes: | ||
label: Description | ||
description: A brief description of the issue. | ||
validations: | ||
required: true | ||
|
||
- type: textarea | ||
id: steps | ||
attributes: | ||
label: Steps to reproduce | ||
description: | | ||
Explain how to reproduce the issue in the development environment. | ||
- type: input | ||
id: version | ||
attributes: | ||
label: Version | ||
description: The release version of the backend or branch/commit. | ||
placeholder: v6.1.0 | ||
validations: | ||
required: true | ||
|
||
- type: input | ||
id: os-version | ||
attributes: | ||
label: Operating system | ||
description: The operating system this issue occurred with. | ||
placeholder: Linux/macOS/Windows | ||
|
||
- type: textarea | ||
id: additional-information | ||
attributes: | ||
label: Additional information | ||
description: | | ||
Use this section to provide any additional information you might have (e.g screenshots or screencasts). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"kind/ci": ci/* | ||
"kind/bug": ["fix/*", "bug/*"] | ||
"kind/chore": chore/* | ||
"kind/refactor": refactor/* | ||
"kind/release": release/* | ||
"kind/revert": revert/* | ||
"kind/security": security/* | ||
"kind/documentation": ["documentation/*", "doc/*"] | ||
"kind/enhancement": ["feat/*", "feature/*"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Lint & Formatting | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
name: Format HCL | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Terraform format | ||
uses: dflook/terraform-fmt@v1 | ||
|
||
- name: Reviewdog suggester | ||
uses: reviewdog/action-suggester@v1 | ||
with: | ||
tool_name: "terraform fmt -recursive" | ||
cleanup: false | ||
|
||
- name: Status check | ||
shell: bash | ||
run: git diff --exit-code | ||
|
||
lint-find-dirs: | ||
runs-on: ubuntu-latest | ||
name: Find modules | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- id: set-matrix | ||
# Ignore directories whose names start with .terraform or obsolete | ||
run: | | ||
matrix=$(find . -type d \( -name '.terraform*' -o -name 'obsolete*' \) -prune -o \ | ||
-name '*.tf' \ | ||
-not -path '*/.terraform/*' \ | ||
-exec dirname {} \; \ | ||
| sort \ | ||
| uniq \ | ||
| jq --raw-input --slurp 'split("\n")| map(select(. != ""))') | ||
echo "matrix=$(echo $matrix)" >> $GITHUB_OUTPUT | ||
outputs: | ||
tfdirs_matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
name: Lint (${{ matrix.tfdir }}) | ||
needs: lint-find-dirs | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
tfdir: ${{ fromJson(needs.lint-find-dirs.outputs.tfdirs_matrix) }} | ||
env: | ||
TFLINT_PLUGIN_DIR: ${{ github.workspace }}/.tflint.d/plugins | ||
TFLINT_CACHE_VER: 1 # Increment this to force a cache refresh | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: hashicorp/setup-terraform@v3 | ||
|
||
- run: terraform init | ||
working-directory: ${{ matrix.tfdir }} | ||
|
||
- name: tflint | ||
uses: reviewdog/action-tflint@v1 | ||
with: | ||
github_token: ${{ secrets.github_token }} | ||
reporter: github-pr-check | ||
fail_on_error: true | ||
tflint_init: true | ||
working_directory: ${{ matrix.tfdir }} | ||
filter_mode: added | ||
tflint_version: "v0.49.0" | ||
# tflint_rulesets: Optional |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: PR Labeler | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
pr-labeler: | ||
permissions: | ||
contents: read # for TimonVS/pr-labeler-action to read config file | ||
pull-requests: write # for TimonVS/pr-labeler-action to add labels in PR | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: TimonVS/pr-labeler-action@v5 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
configuration-path: .github/pr-labeler.yml # optional, .github/pr-labeler.yml is the default value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: "Semantic Title Check" | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
- reopened | ||
|
||
permissions: | ||
pull-requests: read | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
# https://github.com/commitizen/conventional-commit-types/blob/master/index.json | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
types: | | ||
bug | ||
fix | ||
hotfix | ||
chore | ||
ci | ||
feat | ||
doc | ||
epic | ||
perf | ||
refactor | ||
release | ||
revert | ||
test | ||
security |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
name: Close inactive issues | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * 1" | ||
|
||
jobs: | ||
close-issues: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/stale@v8 | ||
with: | ||
days-before-stale: 120 | ||
days-before-close: 60 | ||
exempt-issue-labels: bug,pinned,security,planned | ||
exempt-pr-labels: bug,pinned,security,planned | ||
stale-issue-label: "stale" | ||
stale-pr-label: "stale" | ||
stale-issue-message: | | ||
This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! | ||
close-issue-message: | | ||
This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details. | ||
stale-pr-message: | | ||
This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! | ||
close-pr-message: | | ||
This pr has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details. | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Trivy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
name: Vulnerability scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run Trivy vulnerability scanner in IaC mode | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: "config" | ||
hide-progress: true | ||
format: "sarif" | ||
output: "trivy-results.sarif" | ||
exit-code: "1" | ||
ignore-unfixed: true | ||
severity: "CRITICAL,HIGH" | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: "trivy-results.sarif" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
################################################################# | ||
# Default .gitignore content for all terraform-aws-modules below | ||
################################################################# | ||
|
||
.DS_Store | ||
|
||
# Local .terraform directories | ||
**/.terraform/* | ||
|
||
# Terraform lockfile | ||
.terraform.lock.hcl | ||
|
||
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
*.tfplan | ||
|
||
# Crash log files | ||
crash.log | ||
|
||
# Exclude all .tfvars files, which are likely to contain sentitive data, such as | ||
# password, private keys, and other secrets. These should not be part of version | ||
# control as they are data points which are potentially sensitive and subject | ||
# to change depending on the environment. | ||
*.tfvars | ||
|
||
# Ignore override files as they are usually used to override resources locally and so | ||
# are not checked in | ||
override.tf | ||
override.tf.json | ||
*_override.tf | ||
*_override.tf.json | ||
|
||
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
repos: | ||
- repo: https://github.com/antonbabenko/pre-commit-terraform | ||
rev: "v1.94.1" # Get the latest from: https://github.com/antonbabenko/pre-commit-terraform/releases | ||
hooks: | ||
- id: terraform_fmt | ||
- id: terraform_tflint | ||
- id: terraform_trivy | ||
- id: terraform_docs | ||
args: | ||
- --args=--config=.terraform-docs.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
formatter: "markdown" | ||
|
||
output: | ||
file: README.md | ||
mode: inject | ||
|
||
recursive: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Asyraf Norafandi | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.