-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(elasticloadbalancingv2): Configure cross-zone load balancing for ALB target groups #31790
Comments
Hi @vcschapp , thansk for reaching out. I see the related issue of configuring cross-zone load balancing false for ALB target groups has been discussed here in detail s-#29866 (comment) and a corresponding Workaround was also suggested for target groups-#29866 (comment). Request you to take a look and get back if this does not solve the usecase you are referring to. |
@khushail thanks. The issue you referenced is not related (#31790) and the PR you referenced does not fix the problem (#29907). In issue #31790, the user is requesting to turn off cross-zone at the ALB level, which is not possible. The workaround indicated by codypenta@ doesn't work for me in general because, as I mentioned in the main issue text:
My understanding of the code in CfnResource.addOverride is that there is no way to supplement keys added by CDK. If you use The description for PR #29907 says:
So basically the PR makes CDK throw an exception when you try to turn off cross-zone for ALB at the load balancer level. This is fine, as ALB doesn't support that. But that's not what my issue is about. My issue is about disabling cross-zone at the target group level, which ALB does support, and CloudFormation supports, but CDK does not. |
@vcschapp , thanks so much for explaining that so well and getting back. I understood your point and confirm that its supported by cloudformation as well - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-targetgroup-targetgroupattribute.html#cfn-elasticloadbalancingv2-targetgroup-targetgroupattribute-key So till it is implemented , as a workaround, this should be achievable with Escape hatches using L1 construct. I would be marking this as P2 which means it won't be immediately addresed by the team but would be on their radar and for keeping it open for contribution from community as well as from the team as well. Thanks. |
Comments on closed issues and PRs are hard for our team to see. |
1 similar comment
Comments on closed issues and PRs are hard for our team to see. |
Describe the feature
Expose ALB's existing ability to turn off cross-zone load balancing for ALB target groups, as described in more detail in the Other Information section.
Use Case
Proposed Solution
The constructor for CDK's ApplicationTargetGroup construct should accept a
crossZoneEnabled: boolean
flag in the existing constructor props structure, ApplicationTargetGroupProps.Other Information
Feature supported in ALB
Since November 17, 2022, Application Load Balancers now support turning off cross zone load balancing per target group. See also the Cross-zone load balancing heading on the How Elastic Load Balancing Works user guide page.
Feature supported in CloudFormation
This feature can be used in CloudFormation by setting the following target group attribute:
under the
TargetGroupAttributes
property within an AWS::ElasticLoadBalancingV2::TargetGroup resource properties.No workaround in CDK
In theory, you can workaround this issue in CDK using the CfnTargetGroup.addOverride. However, because adding overrides would entirely replace the values CDK wants to put for the target group attributes, in practice this means adding overrides would force me to replicate CDK's entire logic for target group attributes. This is incredibly frustrating.
Acknowledgements
CDK version used
2.162.1
Environment details (OS name and version, etc.)
Ubuntu Linux 20.04
The text was updated successfully, but these errors were encountered: