Skip to content

aws-batch: Support new default instance classes for EC2 compute environment #35515

@beornf

Description

@beornf

Describe the feature

Support for the new default_x86_64 and default_arm64 instance classes and deprecate the optimal instance class created by the useOptimalInstanceClasses property.

Use Case

I want to be able to select between default_x86_64 and default_arm64 as described in https://aws.amazon.com/blogs/hpc/introducing-default-instance-categories-for-aws-batch/.

We recommend updating your Batch environments to adopt the new categories. However, you are not required to update. Existing AWS Batch compute environments that use optimal remain valid. The CreateComputeEnvironment and UpdateComputeEnvironment API actions continue to accept optimal as a valid value. The behavior of optimal will stay the same until early November 2025. After that, optimal will behave the same as the default_x86_64 instance category.

Proposed Solution

No response

Other Information

There appears to be a regression of logic that warns whenever x86 and arm instance types are mixed.

if (hasArmInstances && hasX86Instances) {
Annotations.of(scope).addWarningV2('@aws-cdk/aws-batch:mixingARMAndx86InstancesNotSupported', 'Cannot mix ARM and x86 instance types or classes, deploying will cause an error');
}
if (hasArmInstances && useOptimalInstanceClasses) {
Annotations.of(scope).addWarningV2('@aws-cdk/aws-batch:optimalNotSupportedWithARM', '\'optimal\' instance types are not supported with ARM instance types or classes. Deploying will cause an error, please set useOptimalInstanceClasses to false');
}
if (useOptimalInstanceClasses || (!hasArmInstances && useOptimalInstanceClasses === undefined)) {
instances.push('optimal');
}

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS CDK Library version (aws-cdk-lib)

2.208.0

AWS CDK CLI version

2.1024.0

Environment details (OS name and version, etc.)

Debian GNU/Linux 12

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-batchRelated to AWS Batcheffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions