Skip to content

feat(ecs): add capacityOptionType (Spot support) to ManagedInstancesCapacityProvider L2 construct#36497

Merged
mergify[bot] merged 8 commits into
aws:mainfrom
djglaser:djglaser/managed-spot-release
Jan 21, 2026
Merged

feat(ecs): add capacityOptionType (Spot support) to ManagedInstancesCapacityProvider L2 construct#36497
mergify[bot] merged 8 commits into
aws:mainfrom
djglaser:djglaser/managed-spot-release

Conversation

@djglaser
Copy link
Copy Markdown
Contributor

@djglaser djglaser commented Dec 24, 2025

Issue # (if applicable)

Relates public PR #35648

Description of changes

ECS is expanding configuration options for a ManagedInstances CapacityProvider by allowing users to set a CapacityOptionType. This is an enum with allowed values of ON_DEMAND and SPOT. This attribute falls under the existing ManagedInstancesCapacityProvider L2 construct.

Feature description

Capacity Option Type provides the purchasing option for the EC2 instances used in the capacity provider. Determines whether to use On-Demand or Spot instances. Valid values are ON_DEMAND and SPOT. Defaults to ON_DEMAND when not specified. Changing this value will trigger replacement of the capacity provider. For more information, see Amazon EC2 billing and purchasing options in the Amazon EC2 User Guide.

Description of how you validated changes

  • Added and validated unit tests
  • Modified existing ManagedInstances integration test to include a CapacityOptionType attribute with a value of SPOT.

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 December 24, 2025 15:35
@github-actions github-actions Bot added repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK p2 labels Dec 24, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ☑️SkippedFailed ❌️
Security Guardian Results24 ran23 passed1 failed
TestResult
Security Guardian Results
packages/@aws-cdk-testing/framework-integ/test/aws-ecs/test/integ.managedinstances-capacity-provider.js.snapshot/integ-managedinstances-capacity-provider.template.json
ec2-no-open-security-groups.guard❌ failure

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 24, 2025

⚠️ Experimental Feature: This security report is currently in experimental phase. Results may include false positives and the rules are being actively refined.
Please try merge from main to avoid findings unrelated to the PR.


TestsPassed ✅SkippedFailed
Security Guardian Results with resolved templates24 ran24 passed
TestResult
No test annotations available

Copy link
Copy Markdown
Member

@Abogical Abogical left a comment

Choose a reason for hiding this comment

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

Discarded comment

Comment thread tools/@aws-cdk/spec2cdk/temporary-schemas/us-east-1/aws-ecs-capacityprovider.json Outdated
@djglaser djglaser force-pushed the djglaser/managed-spot-release branch from f758729 to 5853b3d Compare January 20, 2026 15:21
@mergify mergify Bot dismissed Abogical’s stale review January 20, 2026 15:22

Pull request has been modified.

Comment thread packages/aws-cdk-lib/aws-ecs/lib/cluster.ts Outdated
Co-authored-by: A. Abdel-Rahman <github@abogic.al>
@mergify mergify Bot dismissed Abogical’s stale review January 20, 2026 15:32

Pull request has been modified.

@Abogical
Copy link
Copy Markdown
Member

@Mergifyio update

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 20, 2026

update

❌ Mergify doesn't have permission to update

Details

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

Copy link
Copy Markdown
Member

@Abogical Abogical left a comment

Choose a reason for hiding this comment

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

There is a build error that needs to be checked:

https://github.com/aws/aws-cdk/actions/runs/21178046110/job/60912261759?pr=36497#step:9:1749

Error: aws-cdk-lib: aws-ecs/test/cluster.test.ts:2954:67 - error TS2345: Argument of type '{ infrastructureRole: iam.Role; ec2InstanceProfile: iam.InstanceProfile; subnets: ec2.ISubnet[]; capacityOptionType: ecs.CapacityOptionType.ON_DEMAND; }' is not assignable to parameter of type 'ManagedInstancesCapacityProviderProps'.
aws-cdk-lib:   Property 'securityGroups' is missing in type '{ infrastructureRole: iam.Role; ec2InstanceProfile: iam.InstanceProfile; subnets: ec2.ISubnet[]; capacityOptionType: ecs.CapacityOptionType.ON_DEMAND; }' but required in type 'ManagedInstancesCapacityProviderProps'.

@mergify mergify Bot dismissed Abogical’s stale review January 20, 2026 16:46

Pull request has been modified.

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 20, 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 Jan 20, 2026

Merge Queue Status

🚫 The pull request has left the queue (rule: default-squash) at 692b326

This pull request spent 5 minutes 5 seconds in the queue, with no time running CI.

Reason

Pull request #36497 has been dequeued. The pull request rule doesn't match anymore. The following conditions don't match anymore:

  • #approved-reviews-by>=1
  • #changes-requested-reviews-by=0
  • any of: [🔀 queue conditions]
    • all of: [📌 queue conditions of queue default-squash]
      • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
      • #approved-reviews-by>=1
      • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
      • #changes-requested-reviews-by=0

Hint

You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it.
If you do update this pull request, it will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue instead, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@Abogical Abogical self-requested a review January 20, 2026 21:36
Comment thread packages/aws-cdk-lib/aws-ecs/lib/cluster.ts Outdated
@mergify mergify Bot dismissed Abogical’s stale review January 21, 2026 15:04

Pull request has been modified.

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 21, 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 Jan 21, 2026

Merge Queue Status

✅ The pull request has been merged at 3af430a

This pull request spent 51 minutes 40 seconds in the queue, including 30 minutes 16 seconds running CI.
The checks were run in-place.

Required conditions to merge

@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 21, 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 merged commit e8ad85b into aws:main Jan 21, 2026
20 of 23 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

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 Jan 21, 2026
@djglaser djglaser deleted the djglaser/managed-spot-release branch January 21, 2026 19:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

p2 repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants