Files
terraform-aws-eks/examples/eks-managed-node-group/eks-al2023.tf
ismail yenigul 5c8ac85c5c docs: Set ami_type for AL2023 in the example (#3337)
set ami_type for AL2023

Set AMI type explicitly   into user data type to be able to use cloudinit_pre_nodeadm 

https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/modules/_user_data/main.tf#L33
2025-04-11 17:12:41 -05:00

54 lines
1.4 KiB
HCL

module "eks_al2023" {
source = "terraform-aws-modules/eks/aws"
version = "~> 20.0"
cluster_name = "${local.name}-al2023"
cluster_version = "1.31"
# EKS Addons
cluster_addons = {
coredns = {}
eks-pod-identity-agent = {}
kube-proxy = {}
vpc-cni = {}
}
vpc_id = module.vpc.vpc_id
subnet_ids = module.vpc.private_subnets
eks_managed_node_groups = {
example = {
# Starting on 1.30, AL2023 is the default AMI type for EKS managed node groups
instance_types = ["m6i.large"]
ami_type = "AL2023_x86_64_STANDARD"
min_size = 2
max_size = 5
# This value is ignored after the initial creation
# https://github.com/bryantbiggs/eks-desired-size-hack
desired_size = 2
# This is not required - demonstrates how to pass additional configuration to nodeadm
# Ref https://awslabs.github.io/amazon-eks-ami/nodeadm/doc/api/
cloudinit_pre_nodeadm = [
{
content_type = "application/node.eks.aws"
content = <<-EOT
---
apiVersion: node.eks.aws/v1alpha1
kind: NodeConfig
spec:
kubelet:
config:
shutdownGracePeriod: 30s
featureGates:
DisableKubeletCloudCredentialProviders: true
EOT
}
]
}
}
tags = local.tags
}