Remediation
Enable Cross-Zone Load Balancingβ
From Command Lineβ
For Network and Gateway Load Balancersβ
Enable cross-zone load balancing by updating the load balancer attributes:
aws elbv2 modify-load-balancer-attributes \
--load-balancer-arn {{load-balancer-arn}} \
--attributes "Key=load_balancing.cross_zone.enabled,Value=true"
For Classic Load Balancersβ
aws elb modify-load-balancer-attributes \
--load-balancer-name {{load-balancer-name}} \
--load-balancer-attributes "{\"CrossZoneLoadBalancing\":{\"Enabled\":true}}"
For Application Load Balancersβ
Since cross-zone load balancing is always enabled at the load balancer level, enable it for associated target groups instead:
aws elbv2 modify-target-group-attributes \
--target-group-arn {{target-group-arn}} \
--attributes "Key=load_balancing.cross_zone.enabled,Value=true"