-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minimum required Terraform version bumped to 0.13.0 (#4)
* Github workflow improvements & add gitignore * minimum required Terraform version bumped to 0.13.0 * Update exmaple * Change default chart version
- Loading branch information
Showing
9 changed files
with
155 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,47 +7,45 @@ on: | |
branches: [ master ] | ||
|
||
env: | ||
TERRAFORM_DOCS_VERSION: "v0.9.1" | ||
TFLINT_VERSION: "v0.16.2" | ||
TERRAFORM_DOCS_VERSION: "v0.11.2" | ||
TFLINT_VERSION: "v0.25.0" | ||
TFSEC_VERSION: "v0.39.6" | ||
|
||
jobs: | ||
terraform-validation: | ||
runs-on: ubuntu-latest | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/setup-python@v1 | ||
- uses: actions/setup-python@v2 | ||
name: "SETUP: Python" | ||
|
||
- uses: actions/setup-go@v2 | ||
name: "SETUP: Go" | ||
|
||
- uses: pat-s/[email protected] | ||
- uses: actions/[email protected] | ||
id: cache-terraform-docs | ||
name: "CACHE: terraform-docs Go module" | ||
name: "CACHE: terraform-docs" | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/go/bin/terraform-docs | ||
~/terraform-docs/bin/ | ||
key: ${{ runner.os }}-terraform_docs-${{ env.TERRAFORM_DOCS_VERSION }} | ||
restore-keys: | | ||
${{ runner.os}}-terraform_docs- | ||
- shell: bash | ||
name: "INSTALL: terraform-docs" | ||
if: steps.cache-terraform-docs.output.cache-hit != 'true' | ||
env: | ||
GO111MODULE: "on" | ||
run: | | ||
go get github.com/segmentio/terraform-docs@${{ env.TERRAFORM_DOCS_VERSION }} | ||
wget https://github.com/terraform-docs/terraform-docs/releases/download/${{ env.TERRAFORM_DOCS_VERSION }}/terraform-docs-${{ env.TERRAFORM_DOCS_VERSION }}-linux-amd64.tar.gz | ||
tar xvzf terraform-docs-${{ env.TERRAFORM_DOCS_VERSION }}-linux-amd64.tar.gz | ||
mkdir -p ~/terraform-docs/bin/ | ||
install terraform-docs ~/terraform-docs/bin/ | ||
- shell: bash | ||
name: "SETUP: Go path" | ||
run: echo '::add-path::~/go/bin/' | ||
name: "SETUP: terraform-docs path" | ||
run: echo '~/terraform-docs/bin/' >> $GITHUB_PATH | ||
|
||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v2 | ||
name: Checkout source code | ||
|
||
- uses: pat-s/always-upload-cache@v2.0.0 | ||
- uses: actions/cache@v2 | ||
id: cache-pre-commit-dependencies | ||
name: "CACHE: pip and pre-commit dependencies" | ||
with: | ||
|
@@ -58,9 +56,9 @@ jobs: | |
restore-keys: | | ||
${{ runner.os }}-pip-pre-commit- | ||
- uses: pat-s/always-upload-cache@v2.0.0 | ||
- uses: actions/cache@v2 | ||
id: cache-tflint | ||
name: "CACHE: TFLint" | ||
name: "CACHE: tflint" | ||
with: | ||
path: | | ||
~/tflint/bin/ | ||
|
@@ -74,7 +72,7 @@ jobs: | |
pip install detect-secrets | ||
- shell: bash | ||
name: "INSTALL: TFLint" | ||
name: "INSTALL: tflint" | ||
if: steps.cache-tflint.outputs.cache-hit != 'true' | ||
run: | | ||
wget https://github.com/terraform-linters/tflint/releases/download/${{ env.TFLINT_VERSION }}/tflint_linux_amd64.zip | ||
|
@@ -83,9 +81,30 @@ jobs: | |
install tflint ~/tflint/bin/ | ||
- shell: bash | ||
name: "SETUP: TFLint path" | ||
name: "SETUP: tflint path" | ||
run: echo '~/tflint/bin/' >> $GITHUB_PATH | ||
|
||
- uses: actions/cache@v2 | ||
id: cache-tfsec | ||
name: "CACHE: tfsec" | ||
with: | ||
path: | | ||
~/tfsec/bin/ | ||
key: ${{ runner.os }}-tfsec-${{ env.TFSEC_VERSION }} | ||
restore-keys: | | ||
${{ runner.os }}-tfsec- | ||
- shell: bash | ||
name: "INSTALL: tfsec" | ||
if: steps.cache-tfsec.outputs.cache-hit != 'true' | ||
run: | | ||
echo '::add-path::~/tflint/bin/' | ||
wget https://github.com/tfsec/tfsec/releases/download/${{ env.TFSEC_VERSION }}/tfsec-linux-amd64 | ||
mkdir -p ~/tfsec/bin/ | ||
install tfsec-linux-amd64 ~/tfsec/bin/ | ||
- shell: bash | ||
name: "SETUP: tfsec path" | ||
run: echo '~/tfsec/bin/' >> $GITHUB_PATH | ||
|
||
- uses: pre-commit/[email protected] | ||
name: "RUN: pre-commit" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,36 @@ | ||
.terraform | ||
# Local .terraform directories | ||
**/.terraform/* | ||
|
||
# .tfstate files | ||
*.tfstate | ||
*.tfstate.* | ||
|
||
# Crash log files | ||
crash.log | ||
|
||
# Exclude all .tfvars files, which are likely to contain sentitive data, such as | ||
# password, private keys, and other secrets. These should not be part of version | ||
# control as they are data points which are potentially sensitive and subject | ||
# to change depending on the environment. | ||
# | ||
*.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* | ||
|
||
# Ignore CLI configuration files | ||
.terraformrc | ||
terraform.rc | ||
|
||
.terraform.lock.hcl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,37 @@ | ||
repos: | ||
- repo: git://github.com/antonbabenko/pre-commit-terraform | ||
rev: v1.39.0 | ||
hooks: | ||
- id: terraform_fmt | ||
- id: terraform_docs | ||
args: | ||
- '--args=--no-providers --sort-by-required' | ||
|
||
- repo: git://github.com/pecigonzalo/pre-commit-terraform-vars | ||
rev: 8e947e99c45314397a8caacebefab44d74227b6b | ||
hooks: | ||
- id: terraform-vars | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
rev: v3.4.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: trailing-whitespace | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
- id: detect-aws-credentials | ||
args: | ||
- '--allow-missing-credentials' | ||
args: ['--allow-missing-credentials'] | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
|
||
- repo: https://github.com/gruntwork-io/pre-commit | ||
rev: v0.1.10 | ||
rev: v0.1.12 | ||
hooks: | ||
- id: tflint | ||
- id: terraform-validate | ||
|
||
- repo: git://github.com/antonbabenko/pre-commit-terraform | ||
rev: v1.47.0 | ||
hooks: | ||
- id: terraform_fmt | ||
- id: terraform_tflint | ||
# - id: terraform_tfsec | ||
- id: terraform_docs | ||
args: | ||
- '--args=--hide providers --sort-by-required' | ||
|
||
- repo: git://github.com/pecigonzalo/pre-commit-terraform-vars | ||
rev: v1.0.0 | ||
hooks: | ||
- id: terraform-vars | ||
|
||
- repo: https://github.com/Yelp/detect-secrets | ||
rev: v0.14.3 | ||
hooks: | ||
- id: detect-secrets | ||
args: | ||
- '--baseline' | ||
- '.secrets.baseline' | ||
args: ['--baseline', '.secrets.baseline'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
terraform { | ||
required_version = ">= 0.12.26, < 0.14.0" | ||
required_version = ">= 0.13" | ||
|
||
required_providers { | ||
aws = ">= 2.0, < 4.0" | ||
helm = ">= 1.0, < 1.4.0" | ||
kubernetes = ">=1.10.0" | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = ">= 2.0" | ||
} | ||
helm = { | ||
source = "hashicorp/helm" | ||
version = ">= 1.0" | ||
} | ||
kubernetes = { | ||
source = "hashicorp/kubernetes" | ||
version = ">= 1.10" | ||
} | ||
} | ||
} |