feat(batch): add AL2023 image types and default to AL2023 (under feature flag)#37539
Conversation
Exemption Request This change adds new enum values and a feature flag that only affects the default |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Merge Queue Status
This pull request spent 1 hour 27 minutes 41 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. |
Pull request has been modified.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Merge Queue Status
This pull request spent 1 hour 20 minutes 10 seconds in the queue, including 1 hour 19 minutes 51 seconds running CI. Required conditions to merge
|
|
➡️ PR build request submitted to A maintainer must now check the pipeline and add the |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
Comments on closed issues and PRs are hard for our team to see. |
Add missing enum values for AWS Batch Ec2Configuration:
Introduce feature flag
@aws-cdk/aws-batch:defaultToAL2023that switches the default imageType from AL2 to AL2023 for both ECS and EKS compute environments. Amazon Linux 2 has reached EOL for EKS (Nov 2025) and reaches EOL for ECS in June 2026.For EKS compute environments with a launch template, automatically set
userdataTypetoEKS_NODEADMwhen an AL2023 image type is resolved, as required by the AWS Batch API to ensure nodes join the cluster.Update A1 instance validation to also reject ECS_AL2023_NVIDIA and to correctly resolve the feature-flag-defaulted imageType.
Issue # (if applicable)
Closes #35839, closes #37205.
Reason for this change
Amazon Linux 2 has reached EOL for EKS (Nov 2025) and reaches EOL for ECS
in June 2026. The AWS Batch service already defaults to AL2023 for newly
created compute environments, but CDK still hardcodes
ECS_AL2/EKS_AL2when users don't specify an
imageType.Additionally, the
ECS_AL2023_NVIDIA,EKS_AL2023, andEKS_AL2023_NVIDIAimage types supported by the Batch API were missing from the CDK enum definitions.
Related public documentation:
Description of changes
EcsMachineImageType.ECS_AL2023_NVIDIA,EksMachineImageType.EKS_AL2023,and
EksMachineImageType.EKS_AL2023_NVIDIA@aws-cdk/aws-batch:defaultToAL2023that switches thedefault
imageTypefrom AL2 to AL2023 for both ECS and EKS compute environmentsuserdataTypetoEKS_NODEADMwhen an AL2023 image type is resolved, asrequired by the AWS Batch API to ensure nodes join the cluster
ECS_AL2023_NVIDIAand tocorrectly resolve the feature-flag-defaulted
imageTypeDescribe any new or updated permissions being added
None.
Description of how you validated changes
Unit tests cover all new enum values, feature flag on/off for both ECS and EKS,
userdataTypebehavior with launch templates (including the critical scenariowhere the feature flag defaults to AL2023 with a launch template present), and
A1 instance validation. Build passes with 0 errors. 103 batch tests pass,
118 cx-api tests pass.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license