aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.7k stars 3.93k forks source link

[aws-elasticloadbalancingv2] NLB does not respect crossZoneEnabled flag fully #8976

Open LuqiPan opened 4 years ago

LuqiPan commented 4 years ago

[Not a Contribution]

NLB does not respect crossZoneEnabled flag fully when it's set to false or it's not set

Reproduction Steps

  1. Set crossZoneEnabled to true for a NLB
  2. Run cdk deploy
  3. Observe that cross-zone load balancing is enabled for this NLB
  4. Set crossZoneEnabled to false for the same NLB
  5. Run cdk deploy
  6. Observe that cross-zone load balancing is still enabled for this NLB

Error Log

No error produced by CDK

Environment

Other

Add an else statement here to account for when crossZoneEnabled = false https://github.com/aws/aws-cdk/blob/d6a126508e4bb03f6f9d874c2c6648c3e3661a41/packages/%40aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-load-balancer.ts#L91


This is :bug: Bug Report

rix0rrr commented 4 years ago

So... I gather from this that CloudFormation does not RESET attributes, only SET them? I actually would consider this a CloudFormation bug, as this flies in the face of desired-state configuration.

I would encourage you to report this as a bug to CloudFormation on their public roadmap.


I guess we could still work around it. Looks like the simplest way to do that would be:

this.setAttribute('load_balancing.cross_zone.enabled', `${!!props.crossZoneEnabled}`);
rix0rrr commented 4 years ago

Created issue here: https://github.com/aws-cloudformation/aws-cloudformation-coverage-roadmap/issues/554

github-actions[bot] commented 2 years ago

This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

peterwoodworth commented 2 years ago

Cfn Roadmap says this feature is coming soon 👀