Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cicd:add github-actions with tflint #18

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
41 changes: 41 additions & 0 deletions .github/workflows/tflint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: tflint
on:
pull_request:
paths:
- '**.tf'
- '**.tfvars'
- '**.tfvars.json'
- '**.hcl'

jobs:

tflint:
name: runner / tflint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
name: Checkout source code

- uses: terraform-linters/setup-tflint@v2
name: Setup TFLint
with:
tflint_version: v0.41.0
github_token: ${{ secrets.github_token }}

- uses: hashicorp/setup-terraform@v1
name: Setup Terraform
with:
terraform_version: 1.3.8

- name: Initialize Terraform
run: terraform init

- name: Show version
run: tflint --version

- name: Init TFLint
run: tflint --init

- name: Run TFLint
run: tflint -f compact
39 changes: 0 additions & 39 deletions .github/workflows/tflint.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .tflint.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
config {
module = true
force = false
disabled_by_default = false
}

plugin "aws" {
enabled = true
version = "0.17.1"
source = "github.com/terraform-linters/tflint-ruleset-aws"

}

rule "aws_instance_invalid_type" {
enabled = true
}

rule "aws_instance_previous_type" {
enabled = true
}

rule "terraform_comment_syntax" {
enabled = true
}

rule "terraform_unused_declarations" {
enabled = true
}

rule "terraform_documented_variables" {
enabled = true
}

rule "terraform_typed_variables" {
enabled = true
}

rule "terraform_naming_convention" {
enabled = true
}

rule "terraform_required_version" {
enabled = true
}

rule "terraform_required_providers" {
enabled = true
}

rule "terraform_standard_module_structure" {
enabled = true
}