Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yhakbar committed Jun 23, 2022
0 parents commit a204c99
Show file tree
Hide file tree
Showing 58 changed files with 3,085 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
changelog:
categories:
- title: Breaking Changes 🛠
labels:
- breaking-change
- title: New Features 🎉
labels:
- enhancement
- title: Bug Fixes 🐛
labels:
- bug
- title: Documentation 📖
labels:
- documentation
- title: Other Changes
labels:
- "*"
54 changes: 54 additions & 0 deletions .github/workflows/document.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# This confirms that the repo is properly documented according
# to the information located in README-HEADER.md

name: Document

on:
pull_request:
# Run tests when PRs opened or updated
types: [opened, synchronize]
branches:
- main
concurrency: document-${{ github.base_ref }}
jobs:
document:
name: "Document"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: "Checkout"
uses: actions/checkout@main

- name: Setup asdf
uses: asdf-vm/actions/setup@v1

- name: Cache asdf
id: asdf-cache
uses: actions/cache@v2
with:
path: ~/.asdf/
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}

- name: Setup asdf
if: steps.asdf-cache.outputs.cache-hit != 'true'
uses: asdf-vm/actions/install@v1

- name: "Generate documentation"
run: ./scripts/document.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Confirm"
run: |
if [[ "$(basename "$(git rev-parse --show-toplevel)")" != 'terraform-aws-template' ]]; then
echo "Setting core.fileMode to false to avoid false positives in documentation check."
git config core.fileMode false
if [[ -n $(git status --porcelain) ]]; then
echo "Documentation is not up to date. Run ./scripts/document.sh"
git status -v
git diff
exit 1
fi
fi
46 changes: 46 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This confirms that the repo is properly formatted according
# to the information located in README-HEADER.md

name: Format

on:
pull_request:
# Run tests when PRs opened or updated
types: [opened, synchronize]
branches:
- main
concurrency: format-${{ github.base_ref }}
jobs:
format:
name: "Format"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: "Checkout"
uses: actions/checkout@main

- name: Setup asdf
uses: asdf-vm/actions/setup@v1

- name: Cache asdf
id: asdf-cache
uses: actions/cache@v2
with:
path: ~/.asdf/
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}

- name: Setup asdf
if: steps.asdf-cache.outputs.cache-hit != 'true'
uses: asdf-vm/actions/install@v1

- name: "Format"
run: ./scripts/format.sh

- name: "Confirm"
run: |
if [[ ! -z $(git status --porcelain) ]]; then
echo "Repo is not canonically formatted. Run ./scripts/format.sh"
exit 1
fi
36 changes: 36 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint

on:
pull_request:
# Run linter when PRs opened or updated
types: [opened, synchronize]
branches:
- main
concurrency: lint-${{ github.base_ref }}
jobs:
lint:
name: "Lint"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: "Checkout"
uses: actions/checkout@main

- name: Setup asdf
uses: asdf-vm/actions/setup@v1

- name: Cache asdf
id: asdf-cache
uses: actions/cache@v2
with:
path: ~/.asdf/
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}

- name: Setup asdf
if: steps.asdf-cache.outputs.cache-hit != 'true'
uses: asdf-vm/actions/install@v1

- name: "Lint"
run: ./scripts/lint.sh
31 changes: 31 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Release
on:
push:
branches: [ main ]
concurrency: release-${{ github.base_ref }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@main

- name: Setup asdf
uses: asdf-vm/actions/setup@v1

- name: Cache asdf
id: asdf-cache
uses: actions/cache@v2
with:
path: ~/.asdf/
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}

- name: Setup asdf
if: steps.asdf-cache.outputs.cache-hit != 'true'
uses: asdf-vm/actions/install@v1

- name: Release
run: ./scripts/release.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
27 changes: 27 additions & 0 deletions .github/workflows/todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This confirms that no TODOs have been left in the module.

name: TODO

on:
pull_request:
# Run tests when PRs opened or updated
types: [opened, synchronize]
branches:
- main
concurrency: todo-${{ github.base_ref }}
jobs:
todo:
name: "TODO"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: "Checkout"
uses: actions/checkout@main

- name: "TODO"
run: |
if [[ "$(basename $(git rev-parse --show-toplevel))" != 'terraform-aws-template' ]]; then
./scripts/todo.sh
fi
39 changes: 39 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This confirms that the repo is properly validated according
# to the information located in README-HEADER.md

name: Validate

on:
pull_request:
# Run tests when PRs opened or updated
types: [opened, synchronize]
branches:
- main
concurrency: validate-${{ github.base_ref }}
jobs:
validate:
name: "Validate"
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: "Checkout"
uses: actions/checkout@main

- name: Setup asdf
uses: asdf-vm/actions/setup@v1

- name: Cache asdf
id: asdf-cache
uses: actions/cache@v2
with:
path: ~/.asdf/
key: ${{ runner.os }}-${{ hashFiles('**/.tool-versions') }}

- name: Setup asdf
if: steps.asdf-cache.outputs.cache-hit != 'true'
uses: asdf-vm/actions/install@v1

- name: "Validate Module"
run: ./scripts/validate.sh
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.terraform
examples/artifacts/*
!examples/artifacts/.gitignore
.DS_Store
target
CHANGELOG.md
*.tfstate
*.tfstate.backup
3 changes: 3 additions & 0 deletions .golang-pkgs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
github.com/terraform-docs/[email protected]
github.com/gruntwork-io/[email protected]
github.com/stretchr/[email protected]
6 changes: 6 additions & 0 deletions .terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
formatter: formatter
header-from: README-HEADER.md

sort:
enabled: true
by: required
22 changes: 22 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
plugin "aws" {
enabled = true
version = "0.9.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}

rule "terraform_deprecated_interpolation" {
enabled = true
}
rule "terraform_deprecated_index" {
enabled = true
}
rule "terraform_unused_declarations" {
enabled = true
}
rule "terraform_comment_syntax" {
enabled = true
}
rule "terraform_documented_outputs" {
enabled = true
}
rule "terraform_documented_variables" {
enabled = true
}
rule "terraform_typed_variables" {
enabled = true
}
rule "terraform_module_pinned_source" {
enabled = true
}
rule "terraform_naming_convention" {
enabled = true
}
rule "terraform_required_version" {
enabled = true
}
rule "terraform_required_providers" {
enabled = true
}
rule "terraform_unused_required_providers" {
enabled = true
}
rule "terraform_workspace_remote" {
enabled = true
}
7 changes: 7 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
terraform 1.1.7
golang 1.17.6
ripgrep 13.0.0
tflint 0.34.1
github-cli 2.7.0
fd 8.3.2
terraform-docs 0.16.0
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 PBS

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.
Loading

0 comments on commit a204c99

Please sign in to comment.