Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const Configuration = {

extends: ['@commitlint/config-conventional'],

/*
* Any rules defined here will override rules from @commitlint/config-conventional
*/
rules: {
'body-max-line-length': [2, 'always', 200],
},
};

module.exports = Configuration;
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: terraform
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10

- package-ecosystem: terraform
directory: "/examples"
schedule:
interval: "daily"
open-pull-requests-limit: 10

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build

on: [ push, workflow_dispatch ]

jobs:
examples:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
tf-version: [ 1.1.9, 1.2.9, 1.3.2 ]
steps:
- name: Install terraform v${{ matrix.tf-version }}
run: |
curl -LO https://releases.hashicorp.com/terraform/${{ matrix.tf-version }}/terraform_${{ matrix.tf-version }}_linux_amd64.zip
unzip terraform_${{ matrix.tf-version }}_linux_amd64.zip
sudo mv terraform /usr/local/bin
rm *
- name: Checkout code
uses: actions/checkout@v2
- name: Validate examples terraform v${{ matrix.tf-version }}
run: make examples
build:
needs: [examples]
runs-on: ubuntu-latest
steps:
- run: echo "OK"
7 changes: 5 additions & 2 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
name: Lint Commit Messages

on: [pull_request]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v4
- uses: wagoid/commitlint-github-action@v5
with:
configFile: "./.github/commitlint.config.js"
30 changes: 30 additions & 0 deletions .github/workflows/terrascan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Terrascan
on: [ pull_request ]
# https://github.com/marketplace/actions/terrascan-iac-scanner
jobs:
terrascan:
runs-on: ubuntu-latest
name: terrascan
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run Terrascan
id: terrascan
uses: tenable/terrascan-action@main
with:
iac_type: 'terraform'
iac_version: 'v14'
policy_type: 'aws'
only_warn: true
sarif_upload: true
#non_recursive:
#iac_dir:
#policy_path:
#skip_rules:
#config_path:
#webhook_url:
#webhook_token:
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: terrascan.sarif
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Local .terraform directories
**/.terraform/*

# .tfstate files
*.tfstate
*.tfstate.*

# Crash log files
crash.log

# Ignore any .tfvars files that are generated automatically for each Terraform run. Most
# .tfvars files are managed as part of configuration and so should be included in
# version control.
#
# example.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

# Include override files you do wish to add to version control using negated pattern
#
# !example_override.tf

# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*

examples/**/.terraform.lock.hcl
.idea
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @argoyle @peter-svensson
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/make -f

SHELL = /bin/bash
EXAMPLES = $(shell find ./examples/* -maxdepth 1 -type d -not -path '*/\.*')

.PHONY: examples
examples: $(addprefix example/,$(EXAMPLES))

.PHONY: example/%
example/%:
@echo "Processing example: $(notdir $*)"
@terraform -chdir=$* init
@terraform -chdir=$* validate
@terraform -chdir=$* plan

Empty file added examples/.gitkeep
Empty file.