Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ecs): add availabilityZoneRebalancing property to EcsService #32259

Conversation

ren-yamanashi
Copy link
Contributor

Reason for this change

We can set availabilityZoneRebalancing for a Service from Ecs, but this was not supported in the AWS CDK L2 construct.

Description of changes

Add availabilityZoneRebalancing property to BaseServiceOptions and set in the CfnService

Description of how you validated changes

Added both unit and integration tests.

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 November 23, 2024 02:55
@github-actions github-actions bot added the repeat-contributor [Pilot] contributed between 3-5 PRs to the CDK label Nov 23, 2024
@github-actions github-actions bot added the p2 label Nov 23, 2024
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 has failed. See the aws-cdk-automation comment below for failure reasons. 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.

@ren-yamanashi ren-yamanashi changed the title feat(ecs) add availabilityZoneRebalancing property to EcsService feat(ecs): add availabilityZoneRebalancing property to EcsService Nov 23, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review November 23, 2024 03:00

✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.

Copy link

codecov bot commented Nov 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.17%. Comparing base (d1b07d9) to head (f2eebb0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #32259   +/-   ##
=======================================
  Coverage   77.17%   77.17%           
=======================================
  Files         105      105           
  Lines        7169     7169           
  Branches     1315     1315           
=======================================
  Hits         5533     5533           
  Misses       1455     1455           
  Partials      181      181           
Flag Coverage Δ
suite.unit 77.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
packages/aws-cdk 77.17% <ø> (ø)
---- 🚨 Try these New Features:

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: f2eebb0
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

Comment on lines +417 to +424

/**
* Indicates whether to use Availability Zone rebalancing for the service
*
* For more information, see [Amazon ECS Service Rebalancing](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-rebalancing.html)
* @default - DISABLED
*/
readonly availabilityZoneRebalancing?: AvailabilityZoneRebalancing;
Copy link
Contributor

@isker isker Nov 23, 2024

Choose a reason for hiding this comment

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

I don't think it's correct to put it here. You can't use this feature with EXTERNAL services, and ExternalService extends BaseService. I think it should be a parameter of FargateService and Ec2Service instead.

Comment on lines +1131 to +1137
Not available for the following:

- Use the `Daemon` strategy
- Use the `EXTERNAL` boot type (ECS Anywhere)
- Uses 100% for the `maximumPercent` value.
- Uses a Classic Load Balancer
- Uses the `attribute:ecs.availability-zone` as a task placement constraint
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't we validate these things and throw at synth time?

@isker
Copy link
Contributor

isker commented Nov 23, 2024

Please link to #32226.

@isker
Copy link
Contributor

isker commented Nov 23, 2024

I asked you those questions because I was partway through implementing this myself when I saw this PR. I decided to keep going and opened #32263.

@ren-yamanashi
Copy link
Contributor Author

ren-yamanashi commented Nov 24, 2024

I asked you those questions because I was partway through implementing this myself when I saw this PR. I decided to keep going and opened #32263.

@isker

Thank you for your comment.

I apologies, I missed the relevant issue #32226

After reviewing your comment and #32263, I believe that #32263 is more appropriate and will close this MR.

@ren-yamanashi ren-yamanashi deleted the feat-add-availability-zone-rebalancing branch November 24, 2024 02:27
Copy link

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 Nov 24, 2024
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