Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ module "eks" {
eks_managed_node_groups = {
example = {
# Starting on 1.30, AL2023 is the default AMI type for EKS managed node groups
ami_type = "AL2023_x86_64_STANDARD"
ami_type = "AL2023_X86_64_STANDARD"
instance_types = ["m5.xlarge"]

min_size = 2
Expand Down Expand Up @@ -292,7 +292,7 @@ module "eks" {
example = {
# The EKS AL2023 NVIDIA AMI provides all of the necessary components
# for accelerated workloads w/ EFA
ami_type = "AL2023_x86_64_NVIDIA"
ami_type = "AL2023_X86_64_NVIDIA"
instance_types = ["p5.48xlarge"]

# Exposes all EFA interfaces on the launch template created by the node group(s)
Expand Down
2 changes: 1 addition & 1 deletion docs/UPGRADE-17.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Terraform will perform the following actions:
- resource "random_pet" "node_groups" {
- id = "sincere-squid" -> null
- keepers = {
- "ami_type" = "AL2_x86_64"
- "ami_type" = "AL2_X86_64"
- "capacity_type" = "SPOT"
- "disk_size" = "50"
- "iam_role_arn" = "arn:aws:iam::123456789123:role/test-eks-mwIwsvui20210527220853611600000009"
Expand Down
6 changes: 3 additions & 3 deletions docs/UPGRADE-18.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ module "eks" {

# Managed Node Groups
node_groups_defaults = {
ami_type = "AL2_x86_64"
ami_type = "AL2_X86_64"
disk_size = 50
}

Expand Down Expand Up @@ -456,7 +456,7 @@ module "cluster_after" {
subnet_ids = module.vpc.private_subnets

eks_managed_node_group_defaults = {
ami_type = "AL2_x86_64"
ami_type = "AL2_X86_64"
disk_size = 50
}

Expand Down Expand Up @@ -593,7 +593,7 @@ module "cluster_after" {
- # Managed Node Groups
- node_groups_defaults = {
+ eks_managed_node_group_defaults = {
ami_type = "AL2_x86_64"
ami_type = "AL2_X86_64"
disk_size = 50
}

Expand Down
2 changes: 1 addition & 1 deletion docs/UPGRADE-19.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ EKS managed node groups on `v18.x` by default create a security group that does

# EKS Managed Node Group(s)
eks_managed_node_group_defaults = {
ami_type = "AL2_x86_64"
ami_type = "AL2_X86_64"
instance_types = ["m6i.large", "m5.large", "m5n.large", "m5zn.large"]

attach_cluster_primary_security_group = true
Expand Down
8 changes: 4 additions & 4 deletions docs/UPGRADE-21.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ If you find a bug, please open an issue with supporting configuration to reprodu
- When enabling `enable_efa_support` or creating placement groups within a node group, users must now specify the correct `subnet_ids`; the module no longer tries to automatically select a suitable subnet.
- EKS managed node group:
- IMDS now default to a hop limit of 1 (previously was 2)
- `ami_type` now defaults to `AL2023_x86_64_STANDARD`
- `ami_type` now defaults to `AL2023_X86_64_STANDARD`
- `enable_monitoring` is now set to `false` by default
- `enable_efa_only` is now set to `true` by default
- `use_latest_ami_release_version` is now set to `true` by default
- Support for autoscaling group schedules has been removed
- Self-managed node group:
- IMDS now default to a hop limit of 1 (previously was 2)
- `ami_type` now defaults to `AL2023_x86_64_STANDARD`
- `ami_type` now defaults to `AL2023_X86_64_STANDARD`
- `enable_monitoring` is now set to `false` by default
- `enable_efa_only` is now set to `true` by default
- Support for autoscaling group schedules has been removed
Expand Down Expand Up @@ -221,7 +221,7 @@ module "eks" {

eks_managed_node_groups = {
efa = {
ami_type = "AL2023_x86_64_NVIDIA"
ami_type = "AL2023_X86_64_NVIDIA"
instance_types = ["p5e.48xlarge"]

enable_efa_support = true
Expand Down Expand Up @@ -274,7 +274,7 @@ module "eks" {

eks_managed_node_groups = {
efa = {
ami_type = "AL2023_x86_64_NVIDIA"
ami_type = "AL2023_X86_64_NVIDIA"
instance_types = ["p5e.48xlarge"]

iam_role_additional_policies = {
Expand Down
10 changes: 5 additions & 5 deletions docs/compute_resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Refer to the [EKS Managed Node Group documentation](https://docs.aws.amazon.com/
bottlerocket_default = {
use_custom_launch_template = false

ami_type = "BOTTLEROCKET_x86_64"
ami_type = "BOTTLEROCKET_X86_64"
}
}
```
Expand All @@ -40,7 +40,7 @@ Refer to the [EKS Managed Node Group documentation](https://docs.aws.amazon.com/
```hcl
eks_managed_node_groups = {
bottlerocket_prepend_userdata = {
ami_type = "BOTTLEROCKET_x86_64"
ami_type = "BOTTLEROCKET_X86_64"

bootstrap_extra_args = <<-EOT
# extra args added
Expand All @@ -57,7 +57,7 @@ Refer to the [EKS Managed Node Group documentation](https://docs.aws.amazon.com/
eks_managed_node_groups = {
custom_ami = {
ami_id = "ami-0caf35bc73450c396"
ami_type = "AL2023_x86_64_STANDARD"
ami_type = "AL2023_X86_64_STANDARD"

# By default, EKS managed node groups will not append bootstrap script;
# this adds it back in using the default template provided by the module
Expand Down Expand Up @@ -94,7 +94,7 @@ Refer to the [EKS Managed Node Group documentation](https://docs.aws.amazon.com/
eks_managed_node_groups = {
bottlerocket_custom_ami = {
ami_id = "ami-0ff61e0bcfc81dc94"
ami_type = "BOTTLEROCKET_x86_64"
ami_type = "BOTTLEROCKET_X86_64"

# use module user data template to bootstrap
enable_bootstrap_user_data = true
Expand Down Expand Up @@ -141,7 +141,7 @@ Refer to the [Self Managed Node Group documentation](https://docs.aws.amazon.com
self_managed_node_groups = {
bottlerocket = {
ami_id = data.aws_ami.bottlerocket_ami.id
ami_type = "BOTTLEROCKET_x86_64"
ami_type = "BOTTLEROCKET_X86_64"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion examples/eks-managed-node-group/eks-al2023.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module "eks_al2023" {
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"
ami_type = "AL2023_X86_64_STANDARD"

min_size = 2
max_size = 5
Expand Down
2 changes: 1 addition & 1 deletion examples/eks-managed-node-group/eks-bottlerocket.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module "eks_bottlerocket" {

eks_managed_node_groups = {
example = {
ami_type = "BOTTLEROCKET_x86_64"
ami_type = "BOTTLEROCKET_X86_64"
instance_types = ["m6i.large"]

min_size = 2
Expand Down
2 changes: 1 addition & 1 deletion examples/karpenter/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ module "eks" {

eks_managed_node_groups = {
karpenter = {
ami_type = "BOTTLEROCKET_x86_64"
ami_type = "BOTTLEROCKET_X86_64"
instance_types = ["m5.large"]

min_size = 2
Expand Down
2 changes: 1 addition & 1 deletion examples/self-managed-node-group/eks-al2023.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module "eks_al2023" {

self_managed_node_groups = {
example = {
ami_type = "AL2023_x86_64_STANDARD"
ami_type = "AL2023_X86_64_STANDARD"
instance_type = "m6i.large"

min_size = 2
Expand Down
2 changes: 1 addition & 1 deletion examples/self-managed-node-group/eks-bottlerocket.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module "eks_bottlerocket" {

self_managed_node_groups = {
example = {
ami_type = "BOTTLEROCKET_x86_64"
ami_type = "BOTTLEROCKET_X86_64"
instance_type = "m6i.large"

min_size = 2
Expand Down
2 changes: 1 addition & 1 deletion modules/_user_data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ No modules.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_additional_cluster_dns_ips"></a> [additional\_cluster\_dns\_ips](#input\_additional\_cluster\_dns\_ips) | Additional DNS IP addresses to use for the cluster. Only used when `ami_type` = `BOTTLEROCKET_*` | `list(string)` | `[]` | no |
| <a name="input_ami_type"></a> [ami\_type](#input\_ami\_type) | Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values | `string` | `"AL2023_x86_64_STANDARD"` | no |
| <a name="input_ami_type"></a> [ami\_type](#input\_ami\_type) | Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values | `string` | `"AL2023_X86_64_STANDARD"` | no |
| <a name="input_bootstrap_extra_args"></a> [bootstrap\_extra\_args](#input\_bootstrap\_extra\_args) | Additional arguments passed to the bootstrap script. When `ami_type` = `BOTTLEROCKET_*`; these are additional [settings](https://github.com/bottlerocket-os/bottlerocket#settings) that are provided to the Bottlerocket user data | `string` | `""` | no |
| <a name="input_cloudinit_post_nodeadm"></a> [cloudinit\_post\_nodeadm](#input\_cloudinit\_post\_nodeadm) | Array of cloud-init document parts that are created after the nodeadm document part | <pre>list(object({<br/> content = string<br/> content_type = optional(string)<br/> filename = optional(string)<br/> merge_type = optional(string)<br/> }))</pre> | `[]` | no |
| <a name="input_cloudinit_pre_nodeadm"></a> [cloudinit\_pre\_nodeadm](#input\_cloudinit\_pre\_nodeadm) | Array of cloud-init document parts that are created before the nodeadm document part | <pre>list(object({<br/> content = string<br/> content_type = optional(string)<br/> filename = optional(string)<br/> merge_type = optional(string)<br/> }))</pre> | `[]` | no |
Expand Down
31 changes: 16 additions & 15 deletions modules/_user_data/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,37 @@ resource "null_resource" "validate_cluster_service_cidr" {
}

locals {
is_al2 = startswith(var.ami_type, "AL2_")
is_al2023 = startswith(var.ami_type, "AL2023_")
ami_type = upper(var.ami_type)
is_al2 = startswith(local.ami_type, "AL2_")
is_al2023 = startswith(local.ami_type, "AL2023_")

# Converts AMI type into user data template path
ami_type_to_user_data_path = {
AL2_ARM_64 = "${path.module}/../../templates/al2_user_data.tpl"
AL2_x86_64 = "${path.module}/../../templates/al2_user_data.tpl"
AL2_x86_64_GPU = "${path.module}/../../templates/al2_user_data.tpl"
AL2_X86_64 = "${path.module}/../../templates/al2_user_data.tpl"
AL2_X86_64_GPU = "${path.module}/../../templates/al2_user_data.tpl"

AL2023_x86_64_STANDARD = "${path.module}/../../templates/al2023_user_data.tpl"
AL2023_X86_64_STANDARD = "${path.module}/../../templates/al2023_user_data.tpl"
AL2023_ARM_64_STANDARD = "${path.module}/../../templates/al2023_user_data.tpl"
AL2023_x86_64_NEURON = "${path.module}/../../templates/al2023_user_data.tpl"
AL2023_x86_64_NVIDIA = "${path.module}/../../templates/al2023_user_data.tpl"
AL2023_X86_64_NEURON = "${path.module}/../../templates/al2023_user_data.tpl"
AL2023_X86_64_NVIDIA = "${path.module}/../../templates/al2023_user_data.tpl"
AL2023_ARM_64_NVIDIA = "${path.module}/../../templates/al2023_user_data.tpl"

BOTTLEROCKET_ARM_64 = "${path.module}/../../templates/bottlerocket_user_data.tpl"
BOTTLEROCKET_x86_64 = "${path.module}/../../templates/bottlerocket_user_data.tpl"
BOTTLEROCKET_X86_64 = "${path.module}/../../templates/bottlerocket_user_data.tpl"
BOTTLEROCKET_ARM_64_FIPS = "${path.module}/../../templates/bottlerocket_user_data.tpl"
BOTTLEROCKET_x86_64_FIPS = "${path.module}/../../templates/bottlerocket_user_data.tpl"
BOTTLEROCKET_X86_64_FIPS = "${path.module}/../../templates/bottlerocket_user_data.tpl"
BOTTLEROCKET_ARM_64_NVIDIA = "${path.module}/../../templates/bottlerocket_user_data.tpl"
BOTTLEROCKET_x86_64_NVIDIA = "${path.module}/../../templates/bottlerocket_user_data.tpl"
BOTTLEROCKET_X86_64_NVIDIA = "${path.module}/../../templates/bottlerocket_user_data.tpl"

WINDOWS_CORE_2019_x86_64 = "${path.module}/../../templates/windows_user_data.tpl"
WINDOWS_FULL_2019_x86_64 = "${path.module}/../../templates/windows_user_data.tpl"
WINDOWS_CORE_2022_x86_64 = "${path.module}/../../templates/windows_user_data.tpl"
WINDOWS_FULL_2022_x86_64 = "${path.module}/../../templates/windows_user_data.tpl"
WINDOWS_CORE_2019_X86_64 = "${path.module}/../../templates/windows_user_data.tpl"
WINDOWS_FULL_2019_X86_64 = "${path.module}/../../templates/windows_user_data.tpl"
WINDOWS_CORE_2022_X86_64 = "${path.module}/../../templates/windows_user_data.tpl"
WINDOWS_FULL_2022_X86_64 = "${path.module}/../../templates/windows_user_data.tpl"

CUSTOM = var.user_data_template_path
}
user_data_path = coalesce(var.user_data_template_path, local.ami_type_to_user_data_path[var.ami_type])
user_data_path = coalesce(var.user_data_template_path, local.ami_type_to_user_data_path[local.ami_type])

cluster_dns_ips = flatten(concat([try(cidrhost(var.cluster_service_cidr, 10), "")], var.additional_cluster_dns_ips))

Expand Down
2 changes: 1 addition & 1 deletion modules/_user_data/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ variable "create" {
variable "ami_type" {
description = "Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values"
type = string
default = "AL2023_x86_64_STANDARD"
default = "AL2023_X86_64_STANDARD"
nullable = false
}

Expand Down
2 changes: 1 addition & 1 deletion modules/eks-managed-node-group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module "eks_managed_node_group" {
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | The AWS account ID - pass through value to reduce number of GET requests from data sources | `string` | `""` | no |
| <a name="input_ami_id"></a> [ami\_id](#input\_ami\_id) | The AMI from which to launch the instance. If not supplied, EKS will use its own default image | `string` | `""` | no |
| <a name="input_ami_release_version"></a> [ami\_release\_version](#input\_ami\_release\_version) | The AMI version. Defaults to latest AMI release version for the given Kubernetes version and AMI type | `string` | `null` | no |
| <a name="input_ami_type"></a> [ami\_type](#input\_ami\_type) | Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values | `string` | `"AL2023_x86_64_STANDARD"` | no |
| <a name="input_ami_type"></a> [ami\_type](#input\_ami\_type) | Type of Amazon Machine Image (AMI) associated with the EKS Node Group. See the [AWS documentation](https://docs.aws.amazon.com/eks/latest/APIReference/API_Nodegroup.html#AmazonEKS-Type-Nodegroup-amiType) for valid values | `string` | `"AL2023_X86_64_STANDARD"` | no |
| <a name="input_block_device_mappings"></a> [block\_device\_mappings](#input\_block\_device\_mappings) | Specify volumes to attach to the instance besides the volumes specified by the AMI | <pre>map(object({<br/> device_name = optional(string)<br/> ebs = optional(object({<br/> delete_on_termination = optional(bool)<br/> encrypted = optional(bool)<br/> iops = optional(number)<br/> kms_key_id = optional(string)<br/> snapshot_id = optional(string)<br/> throughput = optional(number)<br/> volume_initialization_rate = optional(number)<br/> volume_size = optional(number)<br/> volume_type = optional(string)<br/> }))<br/> no_device = optional(string)<br/> virtual_name = optional(string)<br/> }))</pre> | `null` | no |
| <a name="input_bootstrap_extra_args"></a> [bootstrap\_extra\_args](#input\_bootstrap\_extra\_args) | Additional arguments passed to the bootstrap script. When `ami_type` = `BOTTLEROCKET_*`; these are additional [settings](https://github.com/bottlerocket-os/bottlerocket#settings) that are provided to the Bottlerocket user data | `string` | `null` | no |
| <a name="input_capacity_reservation_specification"></a> [capacity\_reservation\_specification](#input\_capacity\_reservation\_specification) | Targeting for EC2 capacity reservations | <pre>object({<br/> capacity_reservation_preference = optional(string)<br/> capacity_reservation_target = optional(object({<br/> capacity_reservation_id = optional(string)<br/> capacity_reservation_resource_group_arn = optional(string)<br/> }))<br/> })</pre> | `null` | no |
Expand Down
Loading