Skip to content

Commit

Permalink
#85 Change EBS type to gp3 on EKS managed nodegroup (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
choisungwook authored Dec 14, 2024
1 parent 561837f commit 334f961
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions eks/module/eks/node_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ resource "aws_eks_node_group" "main" {
min_size = each.value["min_size"]
}

launch_template {
id = aws_launch_template.node_group[each.key].id
version = aws_launch_template.node_group[each.key].latest_version
}

depends_on = [
aws_eks_access_entry.cluster_admins,
aws_iam_role_policy_attachment.node_group_AmazonEC2ContainerRegistryReadOnly,
Expand All @@ -24,3 +29,18 @@ resource "aws_eks_node_group" "main" {
aws_iam_role_policy_attachment.node_group_AmazonEKS_CNI_Policy,
]
}

resource "aws_launch_template" "node_group" {
for_each = var.managed_node_groups

name = format("%s-eks-nodegroup-%s", aws_eks_cluster.main.name, each.value["node_group_name"])
block_device_mappings {
device_name = "/dev/xvda"
ebs {
volume_size = 20
volume_type = "gp3"
delete_on_termination = true
encrypted = true
}
}
}

0 comments on commit 334f961

Please # to comment.