mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-19 16:21:09 +01:00
feat: Add support for ML capacity block reservations with EKS managed node group(s) (#3091)
This commit is contained in:
@@ -64,13 +64,13 @@ module "eks_managed_node_group" {
|
||||
| Name | Version |
|
||||
|------|---------|
|
||||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
|
||||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.40 |
|
||||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.57 |
|
||||
|
||||
## Providers
|
||||
|
||||
| Name | Version |
|
||||
|------|---------|
|
||||
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.40 |
|
||||
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.57 |
|
||||
|
||||
## Modules
|
||||
|
||||
|
||||
@@ -203,10 +203,11 @@ resource "aws_launch_template" "this" {
|
||||
}
|
||||
}
|
||||
|
||||
# # Set on node group instead
|
||||
# instance_type = var.launch_template_instance_type
|
||||
kernel_id = var.kernel_id
|
||||
key_name = var.key_name
|
||||
# Instance type(s) are generally set on the node group,
|
||||
# except when a ML capacity block reseravtion is used
|
||||
instance_type = var.capacity_type == "CAPACITY_BLOCK" ? element(var.instance_types, 0) : null
|
||||
kernel_id = var.kernel_id
|
||||
key_name = var.key_name
|
||||
|
||||
dynamic "license_specification" {
|
||||
for_each = length(var.license_specifications) > 0 ? var.license_specifications : {}
|
||||
@@ -408,8 +409,9 @@ resource "aws_eks_node_group" "this" {
|
||||
capacity_type = var.capacity_type
|
||||
disk_size = var.use_custom_launch_template ? null : var.disk_size # if using a custom LT, set disk size on custom LT or else it will error here
|
||||
force_update_version = var.force_update_version
|
||||
instance_types = var.instance_types
|
||||
labels = var.labels
|
||||
# ML capacity block reservation requires instance type to be set on the launch template
|
||||
instance_types = var.capacity_type == "CAPACITY_BLOCK" ? null : var.instance_types
|
||||
labels = var.labels
|
||||
|
||||
dynamic "launch_template" {
|
||||
for_each = var.use_custom_launch_template ? [1] : []
|
||||
|
||||
@@ -4,7 +4,7 @@ terraform {
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 5.40"
|
||||
version = ">= 5.57"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user