File tree 5 files changed +59
-17
lines changed
5 files changed +59
-17
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -4,13 +4,16 @@ Truefoundry AWS Karpenter Module
4
4
<!-- BEGIN_TF_DOCS -->
5
5
## Requirements
6
6
7
- No requirements.
7
+ | Name | Version |
8
+ | ------| ---------|
9
+ | <a name =" requirement_terraform " ></a > [ terraform] ( #requirement\_ terraform ) | >= 1.4 |
10
+ | <a name =" requirement_aws " ></a > [ aws] ( #requirement\_ aws ) | 5.17.0 |
8
11
9
12
## Providers
10
13
11
14
| Name | Version |
12
15
| ------| ---------|
13
- | <a name =" provider_aws " ></a > [ aws] ( #provider\_ aws ) | n/a |
16
+ | <a name =" provider_aws " ></a > [ aws] ( #provider\_ aws ) | 5.17.0 |
14
17
15
18
## Modules
16
19
@@ -22,14 +25,12 @@ No requirements.
22
25
23
26
| Name | Type |
24
27
| ------| ------|
25
- | [ aws_iam_instance_profile.karpenter] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_instance_profile ) | resource |
26
- | [ aws_eks_cluster.cluster] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster ) | data source |
28
+ | [ aws_iam_instance_profile.karpenter] ( https://registry.terraform.io/providers/hashicorp/aws/5.17.0/docs/resources/iam_instance_profile ) | resource |
27
29
28
30
## Inputs
29
31
30
32
| Name | Description | Type | Default | Required |
31
33
| ------| -------------| ------| ---------| :--------:|
32
- | <a name =" input_account_name " ></a > [ account\_ name] ( #input\_ account\_ name ) | AWS Account Name | ` string ` | n/a | yes |
33
34
| <a name =" input_cluster_name " ></a > [ cluster\_ name] ( #input\_ cluster\_ name ) | Cluster Name to install karpenter | ` string ` | n/a | yes |
34
35
| <a name =" input_controller_node_iam_role_arn " ></a > [ controller\_ node\_ iam\_ role\_ arn] ( #input\_ controller\_ node\_ iam\_ role\_ arn ) | The initial node iam role arn | ` string ` | n/a | yes |
35
36
| <a name =" input_controller_nodegroup_name " ></a > [ controller\_ nodegroup\_ name] ( #input\_ controller\_ nodegroup\_ name ) | The initial nodegroup name | ` string ` | n/a | yes |
Original file line number Diff line number Diff line change 1
1
# From https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/examples/irsa/irsa.tf
2
-
3
- data "aws_eks_cluster" "cluster" {
4
- name = var. cluster_name
5
- }
6
-
7
2
module "karpenter_irsa_role" {
8
- source = " terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
9
- version = " 5.27.0"
3
+ source = " terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
4
+ version = " 5.27.0"
10
5
role_name = " ${ var . cluster_name } -karpenter"
11
6
attach_karpenter_controller_policy = true
12
7
@@ -22,9 +17,11 @@ module "karpenter_irsa_role" {
22
17
namespace_service_accounts = [" ${ var . k8s_service_account_namespace } :${ var . k8s_service_account_name } " ]
23
18
}
24
19
}
20
+ tags = local. tags
25
21
}
26
22
27
23
resource "aws_iam_instance_profile" "karpenter" {
28
24
name = " ${ var . cluster_name } -karpenter-${ var . controller_nodegroup_name } "
29
25
role = split (" /" , var. controller_node_iam_role_arn )[1 ]
26
+ tags = local. tags
30
27
}
Original file line number Diff line number Diff line change @@ -28,11 +28,6 @@ variable "controller_nodegroup_name" {
28
28
type = string
29
29
}
30
30
31
- variable "account_name" {
32
- description = " AWS Account Name"
33
- type = string
34
- }
35
-
36
31
variable "tags" {
37
32
type = map (string )
38
33
default = {}
Original file line number Diff line number Diff line change
1
+ terraform {
2
+ required_version = " >= 1.4"
3
+ required_providers {
4
+ aws = {
5
+ source = " hashicorp/aws"
6
+ version = " 5.17.0"
7
+ }
8
+ }
9
+ }
You can’t perform that action at this time.
0 commit comments