Skip to content

Commit 8abc2ef

Browse files
authored
Merge pull request #1 from rhythmictech/init
initial release
2 parents 0057a71 + 2ed5304 commit 8abc2ef

20 files changed

+1107
-0
lines changed

.github/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @rhythmictech/engineering

.github/workflows/misspell.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: misspell
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- prod
9+
- develop
10+
11+
jobs:
12+
misspell:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: misspell
17+
uses: reviewdog/action-misspell@v1
18+
with:
19+
github_token: ${{ secrets.GITHUB_TOKEN }}
20+
locale: "US"
21+
reporter: github-check
22+
filter_mode: nofilter
23+
level: error

.github/workflows/pre-commit.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: pre-commit-check
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- prod
9+
- develop
10+
11+
jobs:
12+
pre-commit-check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python
17+
uses: actions/setup-python@v2
18+
- name: Install prerequisites
19+
run: ./bin/install-ubuntu.sh
20+
- name: initialize Terraform
21+
run: terraform init --backend=false
22+
- name: pre-commit
23+
uses: pre-commit/[email protected]
24+
env:
25+
AWS_DEFAULT_REGION: us-east-1
26+
# many of these are covered by better reviewdog linters below
27+
SKIP: >-
28+
terraform_tflint_deep,
29+
no-commit-to-branch,
30+
terraform_tflint_nocreds,
31+
terraform_tfsec

.github/workflows/pullRequest.yaml

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
name: pull request
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
# TODO: #22 add job using https://github.com/reviewdog/action-alex
8+
pre-commit:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Set up Python
13+
uses: actions/setup-python@v2
14+
- name: Install prerequisites
15+
run: ./bin/install-ubuntu.sh
16+
- name: initialize Terraform
17+
run: terraform init --backend=false
18+
- name: pre-commit
19+
uses: pre-commit/[email protected]
20+
env:
21+
AWS_DEFAULT_REGION: us-east-1
22+
# many of these are covered by better reviewdog linters below
23+
SKIP: >-
24+
terraform_tflint_deep,
25+
no-commit-to-branch,
26+
terraform_tflint_nocreds,
27+
terraform_trivy
28+
tflint:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v2
32+
- name: Install prerequisites
33+
run: ./bin/install-ubuntu.sh
34+
- name: Terraform init
35+
run: terraform init --backend=false
36+
- name: tflint
37+
uses: reviewdog/action-tflint@master
38+
with:
39+
github_token: ${{ secrets.GITHUB_TOKEN }}
40+
reporter: github-pr-check
41+
filter_mode: added
42+
flags: --module
43+
level: error
44+
trivy:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- uses: actions/checkout@v2
48+
- name: Install prerequisites
49+
run: ./bin/install-ubuntu.sh
50+
- name: Terraform init
51+
run: terraform init --backend=false
52+
- name: tfsec
53+
uses: reviewdog/action-tfsec@master
54+
with:
55+
github_token: ${{ secrets.GITHUB_TOKEN }}
56+
reporter: github-pr-check
57+
filter_mode: added
58+
level: warning
59+
misspell:
60+
runs-on: ubuntu-latest
61+
steps:
62+
- uses: actions/checkout@v2
63+
- name: misspell
64+
uses: reviewdog/action-misspell@v1
65+
with:
66+
github_token: ${{ secrets.GITHUB_TOKEN }}
67+
locale: "US"
68+
reporter: github-pr-check
69+
filter_mode: added
70+
level: error
71+
yamllint:
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v2
75+
- name: yamllint
76+
uses: reviewdog/action-yamllint@v1
77+
with:
78+
github_token: ${{ secrets.GITHUB_TOKEN }}
79+
reporter: github-pr-check
80+
filter_mode: added
81+
level: error

.github/workflows/tflint.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: tflint
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- prod
9+
- develop
10+
11+
jobs:
12+
tflint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Install prerequisites
17+
run: ./bin/install-ubuntu.sh
18+
- name: Terraform init
19+
run: terraform init --backend=false
20+
- name: tflint
21+
uses: reviewdog/action-tflint@master
22+
with:
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
reporter: github-check
25+
filter_mode: nofilter
26+
flags: --module
27+
level: error

.github/workflows/trivy.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: trivy
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
trivy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Install prerequisites
14+
run: ./bin/install-ubuntu.sh
15+
- name: Terraform init
16+
run: terraform init --backend=false
17+
- name: Trivy scan
18+
uses: aquasecurity/trivy-action@master
19+
with:
20+
scan-type: 'config'
21+
hide-progress: false
22+
format: 'sarif'
23+
output: 'trivy-results.sarif'
24+
exit-code: '1'
25+
ignore-unfixed: true
26+
severity: 'CRITICAL,HIGH'
27+
28+
- name: Upload Trivy scan results to GitHub Security tab
29+
uses: github/codeql-action/upload-sarif@v2
30+
with:
31+
sarif_file: 'trivy-results.sarif'

.github/workflows/yamllint.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: yamllint
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- prod
9+
- develop
10+
11+
jobs:
12+
yamllint:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: yamllint
17+
uses: reviewdog/action-yamllint@v1
18+
with:
19+
github_token: ${{ secrets.GITHUB_TOKEN }}
20+
reporter: github-check
21+
filter_mode: nofilter
22+
level: error

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Local .terraform directories
2+
**/.terraform/*
3+
4+
# .tfstate files
5+
*.tfstate
6+
*.tfstate.*
7+
8+
# .tfvars files
9+
*.tfvars
10+
11+
# macs
12+
.DS_Store
13+
14+
# temp folders
15+
tmp

.pre-commit-config.yaml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
exclude: ".terraform"
2+
repos:
3+
- repo: https://github.com/antonbabenko/pre-commit-terraform
4+
rev: v1.92.2
5+
hooks:
6+
- id: terraform_docs
7+
always_run: true
8+
- id: terraform_fmt
9+
- id: terraform_validate
10+
args:
11+
- --hook-config=--retry-once-with-cleanup=true
12+
exclude: ^examples
13+
- id: terraform_tflint
14+
alias: terraform_tflint_nocreds
15+
exclude: ^examples
16+
name: terraform_tflint_nocreds
17+
- id: terraform_trivy
18+
args:
19+
- --args=--skip-dirs="**/.terraform,examples/*"
20+
- id: terraform_providers_lock
21+
- repo: https://github.com/pre-commit/pre-commit-hooks
22+
rev: v4.6.0
23+
hooks:
24+
- id: check-added-large-files
25+
- id: check-case-conflict
26+
- id: check-json
27+
- id: check-merge-conflict
28+
- id: check-symlinks
29+
- id: check-yaml
30+
args:
31+
- --unsafe
32+
- id: detect-private-key
33+
- id: end-of-file-fixer
34+
- id: mixed-line-ending
35+
args:
36+
- --fix=lf
37+
- id: no-commit-to-branch
38+
args:
39+
- --branch
40+
- main
41+
- --branch
42+
- master
43+
- --branch
44+
- prod
45+
- id: pretty-format-json
46+
args:
47+
- --autofix
48+
- --top-keys=name,Name
49+
- id: trailing-whitespace
50+
args:
51+
- --markdown-linebreak-ext=md
52+
exclude: README.md
53+
ci:
54+
skip: [terraform_docs, terraform_fmt, terraform_validate, terraform_tflint, terraform_trivy, terraform_providers_lock]

.terraform-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
latest:^1.6

.terraform.lock.hcl

+44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.tflint.hcl

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

.yamllint.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
truthy:
2+
check-keys: false

0 commit comments

Comments
 (0)