diff --git a/modules/karpenter/controller_iam.tf b/modules/karpenter/controller_iam.tf index 9561ab5..e94c555 100644 --- a/modules/karpenter/controller_iam.tf +++ b/modules/karpenter/controller_iam.tf @@ -29,7 +29,7 @@ data "aws_iam_policy_document" "karpenter_controller_assume_role_policy" { } resource "aws_iam_role_policy" "karpenter_controller_v1_beta" { - count = var.v1 ? 0 : 1 + count = var.v1beta ? 1 : 0 name = "KarpenterController-v1beta" role = aws_iam_role.karpenter_controller.id policy = data.aws_iam_policy_document.karpenter_controller_v1_beta.json diff --git a/modules/karpenter/variables.tf b/modules/karpenter/variables.tf index 553edb6..f9c556c 100644 --- a/modules/karpenter/variables.tf +++ b/modules/karpenter/variables.tf @@ -17,10 +17,16 @@ variable "oidc_config" { }) } +variable "v1beta" { + description = "Enable controller policy for v1beta resources (Karpenter >= 0.32.*)" + type = bool + default = true +} + variable "v1" { - description = "Use controller policy for v1 resources (Karpenter >= 1.*)" + description = "Enable controller policy for v1 resources (Karpenter >= 1.*)" type = bool - default = false + default = true } variable "additional_node_role_arns" {