Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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*
- Loading branch information