Skip to content

Commit a371425

Browse files
authored
Initial commit
0 parents  commit a371425

File tree

9 files changed

+230
-0
lines changed

9 files changed

+230
-0
lines changed

.github/CODEOWNERS

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This is a comment.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# These owners will be the default owners for everything in
5+
# the repo. Unless a later match takes precedence,
6+
# @global-owner1 and @global-owner2 will be requested for
7+
# review when someone opens a pull request.
8+
#* @SPHTech/devops
9+
10+
# Order is important; the last matching pattern takes the most
11+
# precedence. When someone opens a pull request that only
12+
# modifies JS files, only @js-owner and not the global
13+
# owner(s) will be requested for a review.
14+
#*.js @js-owner
15+
16+
# You can also use email addresses if you prefer. They'll be
17+
# used to look up users just like we do for commit author
18+
# emails.
19+
20+
21+
# In this example, @doctocat owns any files in the build/logs
22+
# directory at the root of the repository and any of its
23+
# subdirectories.
24+
#/build/logs/ @doctocat
25+
26+
# The `docs/*` pattern will match files like
27+
# `docs/getting-started.md` but not further nested files like
28+
# `docs/build-app/troubleshooting.md`.
29+
30+
31+
# In this example, @octocat owns any file in an apps directory
32+
# anywhere in your repository.
33+
#apps/ @octocat
34+
35+
# In this example, @doctocat owns any file in the `/docs`
36+
# directory in the root of your repository.
37+
#/docs/ @doctocat

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: terraform-ci
2+
on:
3+
pull_request:
4+
permissions:
5+
actions: read
6+
checks: read
7+
contents: read
8+
pull-requests: write
9+
security-events: write
10+
jobs:
11+
ci:
12+
uses: SPHTech-Platform/reusable-workflows/.github/workflows/terraform.yaml@v2
13+
with:
14+
upload_sarif: false
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Pre-commit auto-update
2+
3+
on:
4+
# every sunday at midnight
5+
schedule:
6+
- cron: "0 0 * * 0"
7+
# on demand
8+
workflow_dispatch:
9+
10+
permissions:
11+
actions: read
12+
checks: read
13+
contents: write #require this to write to repo
14+
pull-requests: write #require this to create PR
15+
16+
jobs:
17+
auto-update:
18+
runs-on:
19+
- self-hosted
20+
- platform-eng-ent
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- uses: actions/setup-python@v2
25+
26+
- name: Install pre-commit and run autoupdate
27+
run: |
28+
pip install pre-commit
29+
pre-commit autoupdate
30+
31+
- uses: peter-evans/create-pull-request@v3
32+
with:
33+
token: ${{ secrets.GITHUB_TOKEN }}
34+
branch: update/pre-commit-hooks
35+
title: Update pre-commit hooks
36+
commit-message: "chore: update pre-commit hooks"
37+
body: Update versions of pre-commit hooks to latest version.

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
### Terraform ###
2+
# Local .terraform directories
3+
**/.terraform/*
4+
5+
# Terraform lockfile
6+
.terraform.lock.hcl
7+
8+
# .tfstate files
9+
*.tfstate
10+
*.tfstate.*
11+
*.tfplan
12+
13+
# Crash log files
14+
crash.log
15+
crash.*.log
16+
17+
# Exclude all .tfvars files, which are likely to contain sensitive 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+
#
22+
*.tfvars
23+
24+
# Ignore override files as they are usually used to override resources locally and so
25+
# are not checked in
26+
override.tf
27+
override.tf.json
28+
*_override.tf
29+
*_override.tf.json
30+
31+
# Include override files you do wish to add to version control using negated pattern
32+
# !example_override.tf
33+
34+
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
35+
example: *tfplan*
36+
37+
# Ignore CLI configuration files
38+
.terraformrc
39+
terraform.rc

.pre-commit-config.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
repos:
2+
- repo: https://github.com/gruntwork-io/pre-commit
3+
rev: v0.1.22
4+
hooks:
5+
- id: shellcheck
6+
7+
- repo: https://github.com/tcort/markdown-link-check
8+
rev: v3.11.2
9+
hooks:
10+
- id: markdown-link-check
11+
args:
12+
- "--config=mlc_config.json"
13+
14+
- repo: https://github.com/antonbabenko/pre-commit-terraform
15+
rev: v1.81.2
16+
hooks:
17+
- id: terraform_fmt
18+
- id: terraform_providers_lock
19+
args:
20+
- --args=-platform=linux_amd64
21+
- id: terraform_validate
22+
- id: terraform_tflint
23+
args:
24+
- --args=--module
25+
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
26+
- id: terraform_docs
27+
args:
28+
- --hook-config=--path-to-file=README.md
29+
- --hook-config=--add-to-existing-file=true
30+
- --hook-config=--recursive=true
31+
- id: terraform_tfsec
32+
args:
33+
- --args=--exclude-downloaded-modules
34+
- id: terraform_checkov
35+
36+
- repo: https://github.com/pre-commit/pre-commit-hooks
37+
rev: v4.4.0
38+
hooks:
39+
# Git style
40+
- id: check-added-large-files
41+
- id: check-merge-conflict
42+
- id: check-merge-conflict
43+
- id: no-commit-to-branch
44+
45+
# Common errors
46+
- id: end-of-file-fixer
47+
- id: trailing-whitespace
48+
- id: check-yaml
49+
50+
# Security
51+
- id: detect-aws-credentials
52+
args: ['--allow-missing-credentials']
53+
- id: detect-private-key

.tflint.hcl

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
plugin "aws" {
2+
enabled = true
3+
version = "0.24.3"
4+
source = "github.com/terraform-linters/tflint-ruleset-aws"
5+
}
6+
7+
rule "terraform_deprecated_interpolation" {
8+
enabled = true
9+
}
10+
11+
rule "terraform_documented_outputs" {
12+
enabled = true
13+
}
14+
15+
rule "terraform_documented_variables" {
16+
enabled = true
17+
}
18+
19+
rule "terraform_module_pinned_source" {
20+
enabled = true
21+
}
22+
23+
rule "terraform_typed_variables" {
24+
enabled = true
25+
}
26+
27+
rule "terraform_required_version" {
28+
enabled = false
29+
}
30+
31+
rule "terraform_required_providers" {
32+
enabled = true
33+
}
34+
35+
rule "terraform_standard_module_structure" {
36+
enabled = false
37+
}
38+
39+
rule "terraform_unused_declarations" {
40+
enabled = true
41+
}
42+
43+
rule "terraform_unused_required_providers" {
44+
enabled = true
45+
}
46+
47+
rule "terraform_naming_convention" {
48+
enabled = true
49+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Terraform Modules Template

docs/.gitkeep

Whitespace-only changes.

modules/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)