-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Added
tflint
to Pipeline (#69)
* removed unused files * fixed effect value in IAM policy doc statements and added terraform provider lockfile * chore: Add `tflint` to Pipeline (#68) * fix: AWS IAM Policy Document (#66) * removed unused files * fixed effect value in IAM policy doc statements and added terraform provider lockfile * tflint config * running cd before tflint --init to pickup custom config * removed color option * removed tflint wrapper * added required_version to tf config
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: IAC Checks - tflint | ||
on: | ||
push: | ||
branches: [ master, dev ] | ||
pull_request: | ||
|
||
jobs: | ||
tflint: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Checkout source code | ||
|
||
- uses: actions/cache@v4 | ||
name: Cache plugin dir | ||
with: | ||
path: ~/.tflint.d/plugins | ||
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }} | ||
|
||
- uses: terraform-linters/setup-tflint@v4 | ||
name: Setup TFLint | ||
with: | ||
tflint_version: v0.52.0 | ||
|
||
- name: Show version | ||
run: tflint --version | ||
|
||
- name: Init TFLint | ||
run: cd terraform && tflint --init | ||
env: | ||
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting | ||
GITHUB_TOKEN: ${{ github.token }} | ||
|
||
- name: Run tflint | ||
run: tflint -f compact --recursive --chdir=terraform |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
plugin "terraform" { | ||
enabled = true | ||
preset = "recommended" | ||
} | ||
|
||
plugin "aws" { | ||
enabled = true | ||
version = "0.33.0" | ||
source = "github.com/terraform-linters/tflint-ruleset-aws" | ||
} |
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,4 +1,5 @@ | ||
terraform { | ||
required_version = ">= 1.5" | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
|