docs(batch): correct default allocation strategy for spot compute environments
Issue # (if applicable)
Closes #36348.
Reason for this change
The AWS Batch documentation within the CDK library incorrectly stated that the default Spot allocation strategy is SPOT_CAPACITY_OPTIMIZED. However, the default was changed to SPOT_PRICE_CAPACITY_OPTIMIZED in PR #26731 (August 2023), and several JSDoc @default annotations were never updated.
This resulted in inconsistencies between:
- The published CDK API documentation
- The JSDoc source annotations
- The actual implementation (
determineAllocationStrategy()), which correctly usesSPOT_PRICE_CAPACITY_OPTIMIZED
This PR updates the documentation to accurately reflect the correct behavior.
Description of changes
- Updated all incorrect JSDoc
@defaultannotations inmanaged-compute-environment.ts. - Replaced all mentions of
SPOT_CAPACITY_OPTIMIZEDwithSPOT_PRICE_CAPACITY_OPTIMIZEDin affected interfaces and props. - Ensured consistency across:
-
IManagedEc2EcsComputeEnvironment -
ManagedEc2EcsComputeEnvironmentProps -
IManagedEc2EksComputeEnvironment -
ManagedEc2EksComputeEnvironmentProps
-
- No runtime logic was modified; this PR corrects documentation only.
Alternatives considered:
- Leaving the outdated docs in place — rejected because it causes user confusion.
- Introducing a transitional deprecation note — rejected to maintain clean, accurate documentation.
Design decisions:
- Align JSDoc documentation with the real default used by the CDK implementation.
Describe any new or updated permissions being added
No new or updated IAM permissions are introduced.
This PR updates documentation only.
Description of how you validated changes
- Verified via code inspection that
determineAllocationStrategy()already uses the correct default (SPOT_PRICE_CAPACITY_OPTIMIZED). - Searched for all relevant JSDoc
@defaultcomments and corrected them. - Rebuilt the module to ensure no JSII or TypeScript documentation inconsistencies.
- Confirmed that no integration tests or runtime behavior are affected.
Checklist
- [x] My code adheres to the CONTRIBUTING GUIDE and DESIGN GUIDELINES
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license
| Tests | Passed ❌️ | Skipped | Failed | |
|---|---|---|---|---|
| Security Guardian Results |
| Test | Result |
|---|---|
| No test annotations available | |
| Tests | Passed ❌️ | Skipped | Failed | |
|---|---|---|---|---|
| Security Guardian Results with resolved templates |
| Test | Result |
|---|---|
| No test annotations available | |
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
🚫 The pull request has left the queue (rule: default-squash) at b0deb86ea2f73f08c97a17604c0e2b64da7316f7
This pull request spent 3 minutes 59 seconds in the queue, with no time running CI.
Reason
The pull request can't be updated
For security reasons, Mergify can't update this pull request. Try updating locally. GitHub response: refusing to allow a GitHub App to create or update workflow
.github/workflows/codebuild-pr-build.ymlwithoutworkflowspermission
Hint
You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.
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).
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
🚫 The pull request has left the queue (rule: default-squash) at a028076b1615160a1bb33b758fde03ceceb5485c
This pull request spent 4 seconds in the queue, with no time running CI.
Reason
The pull request can't be updated
For security reasons, Mergify can't update this pull request. Try updating locally. GitHub response: refusing to allow a GitHub App to create or update workflow
.github/workflows/security-guardian.ymlwithoutworkflowspermission
Hint
You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.
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).
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
🚫 The pull request has left the queue (rule: default-squash) at 2ec2eae3b65514ac013b8ce97be2926304bf4038
This pull request spent 4 seconds in the queue, with no time running CI.
Reason
The pull request can't be updated
For security reasons, Mergify can't update this pull request. Try updating locally. GitHub response: refusing to allow a GitHub App to create or update workflow
.github/workflows/security-report.ymlwithoutworkflowspermission
Hint
You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.
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
✅ The pull request has been merged at d8db58dff38db03cb823ea3483e11d6262995090
This pull request spent 7 seconds in the queue, with no time running CI. The checks were run in-place.
Required conditions to merge
-
#approved-reviews-by >= 1[🛡 GitHub branch protection]- [X] #36356
-
#changes-requested-reviews-by = 0[🛡 GitHub branch protection]- [X] #36356
- [X] any of [🛡 GitHub branch protection]:
- [X]
check-success = validate-pr - [ ]
check-neutral = validate-pr - [ ]
check-skipped = validate-pr
- [X]
- [X] any of [🛡 GitHub branch protection]:
- [X]
check-success = build - [ ]
check-neutral = build - [ ]
check-skipped = build
- [X]
Comments on closed issues and PRs are hard for our team to see. If you need help, please open a new issue that references this one.