Skip to content

Conversation

Daniel-ZA
Copy link

@Daniel-ZA Daniel-ZA commented Oct 13, 2025

Issue # (if applicable)

Closes #35710

Reason for this change

The CDK's OnDemandAllocationStrategy enum only includes LOWEST_PRICE, but AWS EMR supports a prioritized allocation strategy that allows users to specify instance type priorities. This enhancement aligns the CDK with the full EMR API capabilities.

Description of changes

  1. Add PRIORITIZED = 'prioritized' to the OnDemandAllocationStrategy enum
  2. Add an optional priority?: number field to InstanceTypeConfigProperty
  3. Update the InstanceTypeConfigPropertyToJson function to map the priority field to the CloudFormation output
  4. Added comprehensive unit tests covering enum values, priority field usage, and CloudFormation template generation
  5. Added integration test demonstrating real-world usage with multiple instance types and priorities

Describe any new or updated permissions being added

No new IAM permissions are required. This change only extends existing EMR cluster creation functionality with additional configuration options.

Description of how you validated changes

Unit tests: Added 3 tests covering enum values, priority field functionality, and CloudFormation output validation
Integration test: Created end-to-end test with realistic EMR cluster configuration using prioritized allocation strategy
Manual validation: Verified CloudFormation templates generate correctly with AllocationStrategy: "prioritized" and Priority: N fields
Backward compatibility: Confirmed existing tests continue to pass without modification

Checklist


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

CDK Developer added 2 commits October 14, 2025 11:34
… strategy

- Add PRIORITIZED option to OnDemandAllocationStrategy enum
- Add optional priority field to InstanceTypeConfigProperty interface
- Update JSON conversion to include priority in CloudFormation output
- Add comprehensive unit and integration tests

Enables users to specify instance type priorities for EMR instance fleets
when using the prioritized allocation strategy, aligning CDK with AWS EMR API.
@aws-cdk-automation aws-cdk-automation requested a review from a team October 13, 2025 22:44
@github-actions github-actions bot added beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Oct 13, 2025
@Daniel-ZA Daniel-ZA changed the title Feat/emr instance fleet priority allocation feat: emr instance fleet priority allocation Oct 13, 2025
Copy link
Collaborator

@aws-cdk-automation aws-cdk-automation left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pull request linter fails with the following errors:

❌ Features must contain a change to an integration test file and the resulting snapshot.

If you believe this pull request should receive an exemption, please comment and provide a justification. A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed, add Clarification Request to a comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(EmrCreateCluster.OnDemandAllocationStrategy): Add support for PRIORITIZED allocation strategy and Priority property in EmrCreateCluster

2 participants