feat(batch): set default spot allocation strategy to SPOT_PRICE_CAPACITY_OPTIMIZED#26731
Merged
mergify[bot] merged 2 commits intomainfrom Aug 12, 2023
Merged
feat(batch): set default spot allocation strategy to SPOT_PRICE_CAPACITY_OPTIMIZED#26731mergify[bot] merged 2 commits intomainfrom
SPOT_PRICE_CAPACITY_OPTIMIZED#26731mergify[bot] merged 2 commits intomainfrom
Conversation
colifran
approved these changes
Aug 12, 2023
Contributor
|
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). |
Collaborator
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Contributor
|
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). |
1 task
mergify bot
pushed a commit
that referenced
this pull request
Dec 19, 2025
…ironments (#36356) ### 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 - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
pahud
pushed a commit
to pahud/aws-cdk
that referenced
this pull request
Jan 24, 2026
…ironments (aws#36356) ### Issue # (if applicable) Closes aws#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 aws#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 - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://aws.amazon.com/about-aws/whats-new/2023/08/aws-batch-price-capacity-optimized-allocation-strategy-spot-instances/ and https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-allocation-strategy.html
SPOT_PRICE_CAPACITY_OPTIMIZEDis now recommended overSPOT_CAPACITY_OPTIMIZED; make it the new default, while the construct is still in alpha.BREAKING CHANGE: if using spot instances on your Compute Environments, they will default to
SPOT_PRICE_CAPACITY_OPTIMIZEDinstead ofSPOT_CAPACITY_OPTIMIZEDnow.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license