mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-01-16 08:37:18 +01:00
fix: Karpenter node IAM role policies variable should be a map of strings, not list (#2771)
This commit is contained in:
@@ -23,7 +23,7 @@ repos:
|
|||||||
- '--args=--only=terraform_standard_module_structure'
|
- '--args=--only=terraform_standard_module_structure'
|
||||||
- '--args=--only=terraform_workspace_remote'
|
- '--args=--only=terraform_workspace_remote'
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.4.0
|
rev: v4.5.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-merge-conflict
|
- id: check-merge-conflict
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
|
|||||||
@@ -160,7 +160,13 @@ module "karpenter" {
|
|||||||
cluster_name = module.eks.cluster_name
|
cluster_name = module.eks.cluster_name
|
||||||
irsa_oidc_provider_arn = module.eks.oidc_provider_arn
|
irsa_oidc_provider_arn = module.eks.oidc_provider_arn
|
||||||
|
|
||||||
policies = {
|
# Used to attach additional IAM policies to the Karpenter controller IRSA role
|
||||||
|
# policies = {
|
||||||
|
# "xxx" = "yyy"
|
||||||
|
# }
|
||||||
|
|
||||||
|
# Used to attach additional IAM policies to the Karpenter node IAM role
|
||||||
|
iam_role_additional_policies = {
|
||||||
AmazonSSMManagedInstanceCore = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
|
AmazonSSMManagedInstanceCore = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -176,7 +182,7 @@ resource "helm_release" "karpenter" {
|
|||||||
repository_username = data.aws_ecrpublic_authorization_token.token.user_name
|
repository_username = data.aws_ecrpublic_authorization_token.token.user_name
|
||||||
repository_password = data.aws_ecrpublic_authorization_token.token.password
|
repository_password = data.aws_ecrpublic_authorization_token.token.password
|
||||||
chart = "karpenter"
|
chart = "karpenter"
|
||||||
version = "v0.21.1"
|
version = "v0.29.0"
|
||||||
|
|
||||||
set {
|
set {
|
||||||
name = "settings.aws.clusterName"
|
name = "settings.aws.clusterName"
|
||||||
|
|||||||
@@ -42,6 +42,11 @@ module "karpenter" {
|
|||||||
irsa_oidc_provider_arn = module.eks.oidc_provider_arn
|
irsa_oidc_provider_arn = module.eks.oidc_provider_arn
|
||||||
irsa_namespace_service_accounts = ["karpenter:karpenter"]
|
irsa_namespace_service_accounts = ["karpenter:karpenter"]
|
||||||
|
|
||||||
|
# Attach additional IAM policies to the Karpenter node IAM role
|
||||||
|
iam_role_additional_policies = {
|
||||||
|
AmazonSSMManagedInstanceCore = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
|
||||||
|
}
|
||||||
|
|
||||||
tags = {
|
tags = {
|
||||||
Environment = "dev"
|
Environment = "dev"
|
||||||
Terraform = "true"
|
Terraform = "true"
|
||||||
@@ -146,7 +151,7 @@ No modules.
|
|||||||
| <a name="input_create_instance_profile"></a> [create\_instance\_profile](#input\_create\_instance\_profile) | Whether to create an IAM instance profile | `bool` | `true` | no |
|
| <a name="input_create_instance_profile"></a> [create\_instance\_profile](#input\_create\_instance\_profile) | Whether to create an IAM instance profile | `bool` | `true` | no |
|
||||||
| <a name="input_create_irsa"></a> [create\_irsa](#input\_create\_irsa) | Determines whether an IAM role for service accounts is created | `bool` | `true` | no |
|
| <a name="input_create_irsa"></a> [create\_irsa](#input\_create\_irsa) | Determines whether an IAM role for service accounts is created | `bool` | `true` | no |
|
||||||
| <a name="input_enable_spot_termination"></a> [enable\_spot\_termination](#input\_enable\_spot\_termination) | Determines whether to enable native spot termination handling | `bool` | `true` | no |
|
| <a name="input_enable_spot_termination"></a> [enable\_spot\_termination](#input\_enable\_spot\_termination) | Determines whether to enable native spot termination handling | `bool` | `true` | no |
|
||||||
| <a name="input_iam_role_additional_policies"></a> [iam\_role\_additional\_policies](#input\_iam\_role\_additional\_policies) | Additional policies to be added to the IAM role | `list(string)` | `[]` | no |
|
| <a name="input_iam_role_additional_policies"></a> [iam\_role\_additional\_policies](#input\_iam\_role\_additional\_policies) | Additional policies to be added to the IAM role | `map(string)` | `{}` | no |
|
||||||
| <a name="input_iam_role_arn"></a> [iam\_role\_arn](#input\_iam\_role\_arn) | Existing IAM role ARN for the IAM instance profile. Required if `create_iam_role` is set to `false` | `string` | `null` | no |
|
| <a name="input_iam_role_arn"></a> [iam\_role\_arn](#input\_iam\_role\_arn) | Existing IAM role ARN for the IAM instance profile. Required if `create_iam_role` is set to `false` | `string` | `null` | no |
|
||||||
| <a name="input_iam_role_attach_cni_policy"></a> [iam\_role\_attach\_cni\_policy](#input\_iam\_role\_attach\_cni\_policy) | Whether to attach the `AmazonEKS_CNI_Policy`/`AmazonEKS_CNI_IPv6_Policy` IAM policy to the IAM IAM role. WARNING: If set `false` the permissions must be assigned to the `aws-node` DaemonSet pods via another method or nodes will not be able to join the cluster | `bool` | `true` | no |
|
| <a name="input_iam_role_attach_cni_policy"></a> [iam\_role\_attach\_cni\_policy](#input\_iam\_role\_attach\_cni\_policy) | Whether to attach the `AmazonEKS_CNI_Policy`/`AmazonEKS_CNI_IPv6_Policy` IAM policy to the IAM IAM role. WARNING: If set `false` the permissions must be assigned to the `aws-node` DaemonSet pods via another method or nodes will not be able to join the cluster | `bool` | `true` | no |
|
||||||
| <a name="input_iam_role_description"></a> [iam\_role\_description](#input\_iam\_role\_description) | Description of the role | `string` | `null` | no |
|
| <a name="input_iam_role_description"></a> [iam\_role\_description](#input\_iam\_role\_description) | Description of the role | `string` | `null` | no |
|
||||||
|
|||||||
@@ -224,7 +224,6 @@ data "aws_iam_policy_document" "queue" {
|
|||||||
"sqs.${local.dns_suffix}",
|
"sqs.${local.dns_suffix}",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -223,8 +223,8 @@ variable "iam_role_attach_cni_policy" {
|
|||||||
|
|
||||||
variable "iam_role_additional_policies" {
|
variable "iam_role_additional_policies" {
|
||||||
description = "Additional policies to be added to the IAM role"
|
description = "Additional policies to be added to the IAM role"
|
||||||
type = list(string)
|
type = map(string)
|
||||||
default = []
|
default = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "iam_role_tags" {
|
variable "iam_role_tags" {
|
||||||
|
|||||||
Reference in New Issue
Block a user