Skip to content

Conversation

@badmintoncryer
Copy link
Contributor

Issue # (if applicable)

Closes #36291.

Reason for this change

The useOptimalInstanceClasses property was deprecated in v2.220 in favor of defaultInstanceClasses, but there is no way to exclude the optimal instance type using defaultInstanceClasses alone. Users who want to specify only custom instance types (e.g., R4 only) without optimal being automatically added have no non-deprecated path forward.

Setting defaultInstanceClasses: [] (empty array) does not prevent optimal from being added because the current logic treats an empty array the same as undefined.

Description of changes

  • Removed @deprecated annotation from useOptimalInstanceClasses property
  • Updated README to remove the deprecation warning and reorganized the "Choosing Your Instance Types" section with:
    • Clear subsections for each use case (Default Instance Classes, Specific Instance Types Only, Optimal Instance Classes)
    • A configuration reference table for quick lookup
    • Example showing how to use useOptimalInstanceClasses: false to exclude optimal

Alternatives considered

Three options were discussed in #36291:

  1. Remove deprecation (this PR) - Restores useOptimalInstanceClasses as a non-deprecated property
  2. Treat empty defaultInstanceClasses: [] as "exclude all defaults" - Would introduces implicit behavior
  3. Change default behavior - Breaking change, not acceptable

Option 1 was chosen because:

  • Minimal code change (documentation only)
  • No risk of breaking existing users
  • useOptimalInstanceClasses provides explicit, clear control that defaultInstanceClasses cannot fully replace

Describe any new or updated permissions being added

N/A

Description of how you validated changes

Existing tests

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

…tanceClasses in favor of defaultInstanceClasses
@aws-cdk-automation aws-cdk-automation requested a review from a team December 10, 2025 15:06
@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p1 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Dec 10, 2025
@badmintoncryer badmintoncryer marked this pull request as draft December 10, 2025 15:06
@github-actions
Copy link
Contributor

github-actions bot commented Dec 10, 2025

TestsPassed ❌️SkippedFailed
Security Guardian Results
TestResult
No test annotations available

@github-actions
Copy link
Contributor

github-actions bot commented Dec 10, 2025

TestsPassed ❌️SkippedFailed
Security Guardian Results with resolved templates
TestResult
No test annotations available

@badmintoncryer badmintoncryer marked this pull request as ready for review December 11, 2025 07:52
@aws-cdk-automation aws-cdk-automation added the pr/needs-maintainer-review This PR needs a review from a Core Team Member label Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This issue is a bug. distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/medium Medium work item – several days of effort p1 pr/needs-maintainer-review This PR needs a review from a Core Team Member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aws-batch: deprecated useOptimalInstanceClasses property is still needed

2 participants