aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

docs(batch): correct default allocation strategy for spot compute environments

Open jasdeepbhalla opened this issue 4 months ago • 2 comments

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 uses SPOT_PRICE_CAPACITY_OPTIMIZED

This PR updates the documentation to accurately reflect the correct behavior.

Description of changes

  • Updated all incorrect JSDoc @default annotations in managed-compute-environment.ts.
  • Replaced all mentions of SPOT_CAPACITY_OPTIMIZED with SPOT_PRICE_CAPACITY_OPTIMIZED in 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 @default comments 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


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

jasdeepbhalla avatar Dec 11 '25 00:12 jasdeepbhalla

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

github-actions[bot] avatar Dec 11 '25 03:12 github-actions[bot]

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

github-actions[bot] avatar Dec 11 '25 03:12 github-actions[bot]

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).

mergify[bot] avatar Dec 15 '25 15:12 mergify[bot]

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.yml without workflows permission

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.

mergify[bot] avatar Dec 15 '25 15:12 mergify[bot]

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).

mergify[bot] avatar Dec 15 '25 15:12 mergify[bot]

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).

mergify[bot] avatar Dec 16 '25 23:12 mergify[bot]

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.yml without workflows permission

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.

mergify[bot] avatar Dec 16 '25 23:12 mergify[bot]

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).

mergify[bot] avatar Dec 16 '25 23:12 mergify[bot]

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).

mergify[bot] avatar Dec 19 '25 00:12 mergify[bot]

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.yml without workflows permission

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.

mergify[bot] avatar Dec 19 '25 00:12 mergify[bot]

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).

mergify[bot] avatar Dec 19 '25 01:12 mergify[bot]

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] any of [🛡 GitHub branch protection]:
    • [X] check-success = build
    • [ ] check-neutral = build
    • [ ] check-skipped = build

mergify[bot] avatar Dec 19 '25 01:12 mergify[bot]

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.

github-actions[bot] avatar Dec 19 '25 01:12 github-actions[bot]