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

docs: elaborate that crossZoneEnabled property cannot be changed for ALB in ELBv2. #29893

Conversation

ashishdhingra
Copy link
Contributor

@ashishdhingra ashishdhingra commented Apr 18, 2024

Issue #29866

Closes #29866.

Reason for this change

Per below documentation:

  • Cross-zone load balancing for target groups, it mentions that With Application Load Balancers, cross-zone load balancing is always turned on at the load balancer level, and cannot be turned off.. It also specifies, For target groups, the default is to use the load balancer setting, but you can override the default by explicitly turning cross-zone load balancing off at the target group level.
  • AWS::ElasticLoadBalancingV2::LoadBalancer LoadBalancerAttribute also specifies for load_balancing.cross_zone.enabled that Indicates whether cross-zone load balancing is enabled. The possible values are true and false. The default for Network Load Balancers and Gateway Load Balancers is false. The default for Application Load Balancers is true, and cannot be changed..

So for Application Load Balancer, cross-zone load balancing is always turned on at the load balancer level, and cannot be turned off.

Description of changes

Elaborate API documentation for ELBv2 that crossZoneEnabled property cannot be changed for ALB in ELBv2.

Description of how you validated changes

N/A

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 beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Apr 18, 2024
@aws-cdk-automation aws-cdk-automation requested a review from a team April 18, 2024 17:10
@github-actions github-actions bot added p2 bug This issue is a bug. labels Apr 18, 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.

@ashishdhingra ashishdhingra changed the title ELaborate that crossZoneEnabled property cannot be changed for ALB in ELBv2. Elaborate that crossZoneEnabled property cannot be changed for ALB in ELBv2. Apr 18, 2024
@ashishdhingra ashishdhingra force-pushed the user/ashdhin/ELB2-CrossZoneEnabled-DocFix-Issue29866 branch from 9f19d1c to c2766ec Compare April 18, 2024 17:19
@ashishdhingra ashishdhingra changed the title Elaborate that crossZoneEnabled property cannot be changed for ALB in ELBv2. docs: elaborate that crossZoneEnabled property cannot be changed for ALB in ELBv2. Apr 18, 2024
@aws-cdk-automation aws-cdk-automation dismissed their stale review April 18, 2024 17:21

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@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 18, 2024
@pahud
Copy link
Contributor

pahud commented Apr 18, 2024

I would suggest we fix here as well:

if (baseProps.crossZoneEnabled) { this.setAttribute('load_balancing.cross_zone.enabled', 'true'); }

Because the L2 crossZoneEnabled prop literally allows you to specify as false but not well handled here. For example, if users set crossZoneEnabled: false in the L2 props, this attribute will always be undefined, which is exactly the same behavior leaving the L2 prop undefined. This is weird to me. What do you think?

@aaythapa aaythapa assigned aaythapa and unassigned aaythapa Apr 18, 2024
@@ -51,7 +51,7 @@ export interface BaseLoadBalancerProps {
/**
* Indicates whether cross-zone load balancing is enabled.
*
* @default - false for Network Load Balancers and true for Application Load Balancers.
* @default - false for Network Load Balancers and true for Application Load Balancers (this cannot be changed).
Copy link
Contributor

Choose a reason for hiding this comment

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

Need some clarification, I see here and here that there are way to disable crossZone for ALB. Why are we saying this cannot be changed here? If we can change it then this should be implement the change suggested here imo. Let me know if I'm understanding this wrong.

Copy link
Contributor Author

@ashishdhingra ashishdhingra Apr 19, 2024

Choose a reason for hiding this comment

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

@aaythapa In #29866 (comment) and #29866 (comment), it is mentioned that the crossZone could be disabled at Target Group level per docs and it already works per example. However, it cannot be changed at ALB level per docs.

Both Target Group level and ALB level are different scopes. :)

This PR is only to make it clear in LoadBalancer docs that it cannot be changed at ALB level. @pahud is coming up with consolidated PR for some additional change (in addition to change in this PR).

NOTE: I'm unsure what will happen in CloudFormation deployment if we enforce crossZone to false, when service itself doesn't support disabling it at ALB level (will it fail or will it ignore it).

@ashishdhingra
Copy link
Contributor Author

Closing this PR in favor of #29907.

@ashishdhingra ashishdhingra deleted the user/ashdhin/ELB2-CrossZoneEnabled-DocFix-Issue29866 branch April 19, 2024 19:31
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 bug This issue is a bug. p2 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-elb: Disabling cross zone load balancing is not respected in Java CDK
4 participants