Skip to content

Commit db0e6dc

Browse files
authored
Merge pull request #4 from sterliakov/feature/st-initial
feat: Initial setup
2 parents e816a94 + d7fcc2f commit db0e6dc

Some content is hidden

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

50 files changed

+988
-1033
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,30 @@
11
version: 2
22
updates:
3-
43
# GitHub actions
5-
- package-ecosystem: "github-actions"
6-
directory: "/" # For GitHub Actions "/" must be used for workflow files in ".github/workflows"
4+
- package-ecosystem: github-actions
5+
directory: / # For GitHub Actions "/" must be used for workflow files in ".github/workflows"
76
schedule:
8-
interval: "weekly"
7+
interval: monthly
98
commit-message:
10-
prefix: "chore: "
9+
prefix: 'chore: '
1110
labels:
12-
- "release/patch"
11+
- release/patch
1312

1413
# Terraform
15-
- package-ecosystem: "terraform"
16-
directory: "/"
17-
schedule:
18-
interval: "weekly"
19-
commit-message:
20-
prefix: "chore: "
21-
labels:
22-
- "release/patch"
23-
24-
- package-ecosystem: "terraform"
25-
directory: "/examples/complete/"
14+
- package-ecosystem: terraform
15+
directory: /
2616
schedule:
27-
interval: "weekly"
17+
interval: monthly
2818
commit-message:
29-
prefix: "chore: "
19+
prefix: 'chore: '
3020
labels:
31-
- "release/patch"
21+
- release/patch
3222

33-
- package-ecosystem: "terraform"
34-
directory: "/examples/simple/"
23+
- package-ecosystem: terraform
24+
directory: /examples/lambda/
3525
schedule:
36-
interval: "weekly"
26+
interval: monthly
3727
commit-message:
38-
prefix: "chore: "
28+
prefix: 'chore: '
3929
labels:
40-
- "release/patch"
30+
- release/patch

.github/workflows/check.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Lint and Test
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: 0 12 * * 1
12+
13+
env:
14+
TEST_ROLE: arn:aws:iam::533267002298:role/ecr-test-role
15+
16+
jobs:
17+
pre-commit:
18+
name: Pre-commit hooks
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.12'
26+
- uses: hashicorp/setup-terraform@v3
27+
- uses: terraform-linters/setup-tflint@v4
28+
name: Setup TFLint
29+
with:
30+
tflint_version: latest
31+
- name: Install terraform-docs
32+
run: |
33+
cd "$(mktemp -d)"
34+
curl -Lo ./terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.19.0/terraform-docs-v0.19.0-$(uname)-amd64.tar.gz
35+
tar -xzf terraform-docs.tar.gz
36+
chmod +x terraform-docs
37+
echo "$PWD" >> $GITHUB_PATH
38+
39+
- name: Init TFLint
40+
run: tflint --init
41+
env:
42+
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
43+
GITHUB_TOKEN: ${{ github.token }}
44+
45+
- uses: pre-commit/[email protected]
46+
with:
47+
extra_args: --all-files --show-diff-on-failure
48+
49+
test:
50+
name: Test
51+
needs: pre-commit
52+
runs-on: ubuntu-latest
53+
permissions:
54+
id-token: write
55+
contents: read
56+
strategy:
57+
fail-fast: false
58+
matrix:
59+
terraform_version: [1.7.0, latest]
60+
steps:
61+
- uses: actions/checkout@v4
62+
- uses: hashicorp/setup-terraform@v3
63+
with:
64+
terraform_version: ${{ matrix.terraform_version }}
65+
- uses: aws-actions/configure-aws-credentials@v4
66+
with:
67+
role-to-assume: ${{ env.TEST_ROLE }}
68+
aws-region: us-east-1
69+
- name: test
70+
run: |
71+
terraform init
72+
terraform test

.github/workflows/pr-title.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
name: Validate PR title
22

33
permissions:
4-
pull-requests: read
5-
statuses: write
4+
pull-requests: read
65

76
on:
8-
pull_request_target:
9-
types:
10-
- opened
11-
- edited
12-
- synchronize
7+
pull_request_target:
8+
branches:
9+
- main
10+
types:
11+
- opened
12+
- edited
13+
- synchronize
14+
- reopened
1315

1416
jobs:
15-
main:
16-
uses: getindata/github-workflows/.github/workflows/gh-validate-pr-title.yml@v1
17+
main:
18+
name: Validate PR title
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: amannn/action-semantic-pull-request@v5
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pre-commit.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
name: Create new release with changelog
1+
name: Publish Release
22

33
permissions:
4-
contents: write
5-
pull-requests: write
4+
contents: write
65

76
on:
8-
pull_request_target:
9-
types: [closed]
7+
push:
8+
tags:
9+
- v*.*.*
1010

1111
jobs:
12-
release:
13-
uses: getindata/github-workflows/.github/workflows/gh-create-release.yml@v1
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Release
17+
uses: softprops/action-gh-release@v2

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ override.tf.json
3333
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
3434
# example: *tfplan*
3535
*tfplan*
36+
37+
# Checkov
38+
.external_modules

.pre-commit-config.yaml

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,54 @@
11
repos:
2-
- repo: https://github.com/gruntwork-io/pre-commit
3-
rev: "v0.1.23" # Get the latest from: https://github.com/gruntwork-io/pre-commit/releases
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
44
hooks:
5-
- id: terraform-validate # It should be the first step as it runs terraform init required by tflint
6-
- id: terraform-fmt
7-
- id: tflint
8-
args:
9-
- "--config=__GIT_ROOT__/.tflint.hcl"
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-merge-conflict
8+
- id: check-executables-have-shebangs
9+
- id: check-shebang-scripts-are-executable
10+
- id: check-symlinks
11+
- id: mixed-line-ending
12+
args: [--fix=lf]
13+
- id: check-yaml
14+
- id: check-json
15+
- id: pretty-format-json
16+
args: [--autofix, --no-ensure-ascii]
1017

11-
- repo: https://github.com/terraform-docs/terraform-docs
12-
rev: "v0.18.0" # Get the latest from: https://github.com/terraform-docs/terraform-docs/releases
18+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
19+
rev: v2.14.0
1320
hooks:
14-
- id: terraform-docs-go
15-
args: ["."]
21+
- id: pretty-format-yaml
22+
args: [--autofix, --indent, '4']
1623

17-
- repo: https://github.com/bridgecrewio/checkov.git
18-
rev: "3.2.216" # Get the latest from: https://github.com/bridgecrewio/checkov/releases
24+
- repo: https://github.com/shellcheck-py/shellcheck-py
25+
rev: v0.10.0.1
1926
hooks:
20-
- id: checkov
21-
args: [--skip-check, "CKV_TF_1"] # Terraform module sources do not use a git url with a commit hash revision
27+
- id: shellcheck
28+
args: [-x, -P, SCRIPTDIR, -S, style]
2229

23-
- repo: https://github.com/pre-commit/pre-commit-hooks
24-
rev: "v4.6.0" # Get the latest from: https://github.com/pre-commit/pre-commit-hooks/releases
30+
- repo: https://github.com/antonbabenko/pre-commit-terraform
31+
rev: v1.96.1
2532
hooks:
26-
- id: check-merge-conflict
27-
args: ["--assume-in-merge"]
28-
- id: mixed-line-ending
29-
args: ["--fix=no"]
30-
- id: end-of-file-fixer
31-
- id: check-case-conflict
32-
- id: check-yaml
33+
- id: terraform_validate
34+
- id: terraform_fmt
35+
- id: terraform_tflint
36+
- id: terraform_docs
37+
args:
38+
- --hook-config=--config-file=.terraform-docs.yml
39+
40+
- repo: https://github.com/bridgecrewio/checkov.git
41+
rev: 3.2.277
42+
hooks:
43+
- id: checkov
44+
args:
45+
- --download-external-modules
46+
- 'true'
47+
- --compact
48+
- --skip-check
49+
# Terraform module sources do not use a git url with a commit hash revision
50+
- CKV_TF_1
51+
- --skip-path
52+
- examples/
53+
- --skip-path
54+
- tests/

.terraform-docs.yml

Lines changed: 35 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,55 @@
1-
formatter: "md tbl" # this is required
1+
formatter: md tbl # this is required
22

3-
version: ">= 0.14"
4-
5-
recursive:
6-
enabled: true
7-
path: ./examples
3+
version: '>= 0.14'
84

95
sections:
10-
hide: []
11-
show: [all]
6+
hide: []
7+
show: [all]
128

139
content: |-
14-
{{ .Header }}
10+
{{ .Header }}
1511
16-
{{ .Footer }}
12+
{{ .Footer }}
1713
18-
{{ .Inputs }}
14+
{{ .Inputs }}
1915
20-
{{ .Modules }}
16+
{{ .Modules }}
2117
22-
{{ .Outputs }}
18+
{{ .Outputs }}
2319
24-
{{ .Providers }}
20+
{{ .Providers }}
2521
26-
{{ .Requirements }}
22+
{{ .Requirements }}
2723
28-
{{ .Resources }}
24+
{{ .Resources }}
2925
3026
output:
31-
file: "README.md"
32-
mode: inject
33-
template: |-
34-
<!-- BEGIN_TF_DOCS -->
35-
{{ .Content }}
36-
<!-- END_TF_DOCS -->
27+
file: README.md
28+
mode: inject
29+
template: |-
30+
<!-- BEGIN_TF_DOCS -->
31+
{{ .Content }}
32+
<!-- END_TF_DOCS -->
3733
3834
output-values:
39-
enabled: false
40-
from: ""
35+
enabled: false
36+
from: ''
4137

4238
sort:
43-
enabled: true
44-
by: name
39+
enabled: true
40+
by: name
4541

4642
settings:
47-
anchor: true
48-
color: true
49-
default: true
50-
description: false
51-
escape: true
52-
hide-empty: false
53-
html: true
54-
indent: 2
55-
lockfile: false
56-
read-comments: true
57-
required: true
58-
sensitive: true
59-
type: true
43+
anchor: true
44+
color: true
45+
default: true
46+
description: false
47+
escape: true
48+
hide-empty: false
49+
html: true
50+
indent: 2
51+
lockfile: false
52+
read-comments: true
53+
required: true
54+
sensitive: true
55+
type: true

CODEOWNERS

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)