Skip to content

Commit f6c902e

Browse files
authored
fix(elasticloadbalancingv2): crossZoneEnabled does not support false for ALB (#29907)
### Issue # (if applicable) Closes #29866 ### Reason for this change `crossZoneEnabled` is not well handled when it's `false` with ALB. Because: 1. When the L2 prop is set `false`, it will not pass down to the L1 and won't throw any error as ALB does not support being disabled. It just silently ignore it. 2. When the prop is `false` for NLB, the L1 attribute will be `undefined`, which is having the same result but it should be explicitly set as `false` in L1. This PR covers the following cases: 1. When `crossZoneEnabled` is `true`, `load_balancing.cross_zone.enabled` should be `true`. 2. When `crossZoneEnabled` is `false`, `load_balancing.cross_zone.enabled` should be `false`, rather than `undefined`. 3. When `crossZoneEnabled` is `false` with ALB, cdk throws an error because ALB does not support disabling it per [doc](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-elasticloadbalancingv2-loadbalancer-loadbalancerattribute.html) description. 4. NLB supports either `true` or `false`. 5. This prop can be `undefined` for ALB or NLB. 6. Improve the doc string for the `crossZoneEnabled` prop. ### Description of changes ### Description of how you validated changes ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 3dd834d commit f6c902e

File tree

13 files changed

+1909
-1
lines changed

13 files changed

+1909
-1
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-elasticloadbalancingv2/test/integ.crosszone.js.snapshot/aws-cdk-elbv2-integ.assets.json

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)