Skip to content

chore(batch): init base EC2 class for ECS and EKS#35868

Merged
mergify[bot] merged 3 commits intoaws:mainfrom
phuhung273:batch-env
Apr 8, 2026
Merged

chore(batch): init base EC2 class for ECS and EKS#35868
mergify[bot] merged 3 commits intoaws:mainfrom
phuhung273:batch-env

Conversation

@phuhung273
Copy link
Copy Markdown
Contributor

@phuhung273 phuhung273 commented Oct 28, 2025

Issue # (if applicable)

Close #35859

Reason for this change

  • Keep codebase clean
  • Prevent the case when adding a new feature to ECS but forgot to do the same for EKS
  • Streamline future change, eg: (aws-batch): AWS Batch Compute Environment For AL2023 #35839
  • A foundation to also reduce duplication for defaultInstanceClasses, useOptimalInstanceClasses, allocationStrategy, spotBidPercentage, instanceRole, launchTemplate, minvCpus, placementGroup and their related functions. I don't want to submit a huge refactor PR directly.

Description of changes

Init base EC2 class for ECS and EKS, start with only minimal things:

  • property instanceTypes
  • property instanceClasses
  • method addInstanceType
  • method addInstanceClass

Description of how you validated changes

Unit + Integ

Checklist


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

@aws-cdk-automation aws-cdk-automation requested a review from a team October 28, 2025 04:34
@github-actions github-actions bot added p2 distinguished-contributor [Pilot] contributed 50+ PRs to the CDK labels Oct 28, 2025
@phuhung273 phuhung273 mentioned this pull request Oct 28, 2025
1 task
@github-actions github-actions bot added effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. labels Oct 30, 2025
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Oct 30, 2025
Copy link
Copy Markdown
Contributor

@abidhasan-aws abidhasan-aws left a comment

Choose a reason for hiding this comment

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

Hi @phuhung273 ,
Thanks for the contribution.

I just have a small nit comment.

readonly instanceTypes: ec2.InstanceType[];

/**
* The instance types that this Compute Environment can launch.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the this should be instance classes instead of instance types

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your review. I've corrected this comment

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 2, 2026
@mergify mergify bot dismissed abidhasan-aws’s stale review April 3, 2026 11:16

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 3, 2026
abidhasan-aws
abidhasan-aws previously approved these changes Apr 7, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 7, 2026

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
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 7, 2026

Merge Queue Status

  • Entered queue2026-04-07 15:23 UTC · Rule: default-squash
  • 🚫 Left the queue2026-04-07 15:23 UTC · at 64dd2ceacf0fb0a1e90c0b9520dc26b6f439f175

This pull request spent 7 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/pr-linter.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 queue comment.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 7, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 7, 2026

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 mergify bot dismissed abidhasan-aws’s stale review April 8, 2026 02:12

Pull request has been modified.

@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 8, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 8, 2026

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
Copy link
Copy Markdown
Contributor

mergify bot commented Apr 8, 2026

Merge Queue Status

  • Entered queue2026-04-08 07:27 UTC · Rule: default-squash
  • Checks skipped · PR is already up-to-date
  • Merged2026-04-08 07:27 UTC · at 9b54dccc30bbdc0d1aeee86b6e0d6aa882f58946

This pull request spent 11 seconds in the queue, including 1 second running CI.

Required conditions to merge

@mergify mergify bot merged commit c60f225 into aws:main Apr 8, 2026
30 of 31 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

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 github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2026
@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Apr 8, 2026
@phuhung273 phuhung273 deleted the batch-env branch April 8, 2026 10:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

distinguished-contributor [Pilot] contributed 50+ 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.

batch: duplicate code in ManagedEc2EcsComputeEnvironment and ManagedEc2EksComputeEnvironment

3 participants