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(elasticloadbalancingv2): minimum Loadbalancer Capacity Unit (LCU) reservation #32382

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

badmintoncryer
Copy link
Contributor

Issue # (if applicable)

None

Reason for this change

ELB now supports for reserving minimum LCUs for both Application and Network load balancers.

ALB: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/capacity-unit-reservation.html
NLB: https://docs.aws.amazon.com/elasticloadbalancing/latest/network/capacity-unit-reservation.html

Description of changes

  • Add minimumCapacityUnit to BaseLoadBalancerProps
  • Verify whether minimumCapacityUnit is a positive integer

Description of how you validated changes

Add both unit and integ tests.

Checklist


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

@github-actions github-actions bot added the p2 label Dec 4, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team December 4, 2024 12:28
@github-actions github-actions bot added the distinguished-contributor [Pilot] contributed 50+ PRs to the CDK label Dec 4, 2024
@badmintoncryer
Copy link
Contributor Author

badmintoncryer commented Dec 4, 2024

I've requested for reserved minimum LCU quotas to execute integ test.

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.

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.84%. Comparing base (71c492a) to head (971842b).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #32382   +/-   ##
=======================================
  Coverage   80.84%   80.84%           
=======================================
  Files         232      232           
  Lines       14135    14135           
  Branches     2460     2460           
=======================================
  Hits        11428    11428           
  Misses       2427     2427           
  Partials      280      280           
Flag Coverage Δ
suite.unit 80.84% <ø> (ø)

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

Components Coverage Δ
packages/aws-cdk 79.64% <ø> (ø)
packages/aws-cdk-lib/core 82.17% <ø> (ø)

@aws-cdk-automation
Copy link
Collaborator

This PR has been in the CHANGES REQUESTED state for 3 weeks, and looks abandoned. To keep this PR from being closed, please continue work on it. If not, it will automatically be closed in a week.

@aws-cdk-automation aws-cdk-automation dismissed their stale review December 27, 2024 00:55

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

if (
minimumCapacityUnit &&
!Token.isUnresolved(minimumCapacityUnit) &&
(minimumCapacityUnit < 100 || minimumCapacityUnit > 1500)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To set invalid LCU causes deployment failure.

Failed resources:
MinimumCapacityUnitAlbStack | 10:09:09 PM | CREATE_FAILED        | AWS::ElasticLoadBalancingV2::LoadBalancer | LB (LB8A12904C) Resource handler returned message: "CapacityUnits value must be between 100 and 1500, inclusive for load balancers of type 'application` (Service: ElasticLoadBalancingV2, Status Code: 400, Request ID: 5d0ee330-3b5c-4100-81c2-8d41d8a78065)" (RequestToken: 5c14d4bf-6259-f3d5-e9b3-9db4449cff9d, HandlerErrorCode: InvalidRequest)


if (minimumCapacityUnit && !Token.isUnresolved(minimumCapacityUnit)) {
const capacityUnitPerAz = minimumCapacityUnit / (props.vpc?.availabilityZones.length ?? 1);
if (capacityUnitPerAz < 2750 || capacityUnitPerAz > 45000) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To set invalid minimum capacity unit causes deployment failure.

Failed resources:
MinimumCapacityUnitNlbStack | 8:09:17 PM | CREATE_FAILED        | AWS::ElasticLoadBalancingV2::LoadBalancer | LB (LB8A12904C) Resource handler returned message: "For load balancer type 'network`, CapacityUnits must be distributed at each zone between 2750 and 45000. (Service: ElasticLoadBalancingV2, Status Code: 400, Request ID: fe443fa7-f642-4f38-b9ca-3d8ce50b830e)" (RequestToken: 35fe4839-faa1-b459-ebd8-8f8553ab3cce, HandlerErrorCode: InvalidRequest)

@badmintoncryer badmintoncryer marked this pull request as ready for review January 29, 2025 13:26
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
distinguished-contributor [Pilot] contributed 50+ PRs to the CDK p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants