Skip to content

Commit da71708

Browse files
committed
added support of tags and terraform linter
1 parent 2337f08 commit da71708

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/workflows/tflint.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Lint
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
7+
jobs:
8+
tflint:
9+
runs-on: ${{ matrix.os }}
10+
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest, macos-latest, windows-latest]
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
name: Checkout source code
18+
19+
- uses: actions/cache@v3
20+
name: Cache plugin dir
21+
with:
22+
path: ~/.tflint.d/plugins
23+
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
24+
25+
- uses: terraform-linters/setup-tflint@v3
26+
name: Setup TFLint
27+
with:
28+
tflint_version: v0.47.0
29+
30+
- name: Show version
31+
run: tflint --version
32+
33+
- name: Init TFLint
34+
run: tflint --init
35+
env:
36+
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
37+
GITHUB_TOKEN: ${{ github.token }}
38+
39+
- name: Run TFLint
40+
run: tflint --minimum-failure-severity=error -f compact

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,5 @@ module "karpenter_irsa_role" {
2323
resource "aws_iam_instance_profile" "karpenter" {
2424
name = "${var.cluster_name}-karpenter-${var.controller_nodegroup_name}"
2525
role = split("/", var.controller_node_iam_role_arn)[1]
26+
tags = local.tags
2627
}

0 commit comments

Comments
 (0)