amazon-web-servicesaws-cloudformationaws-cdk

AWS Application Load Balancer cannot be updated, must be re-created


Using CDK, I toggled the internetFacing property of an Application Load Balancer resource from true to false. When I deploy the stack, I get this output:

my-stack |  0/19 | 4:47:31 PM | UPDATE_IN_PROGRESS   | AWS::ElasticLoadBalancingV2::LoadBalancer   | ApplicationLoadBalancer (ApplicationLoadBalancerFD56DEE1) Requested update requires the creation of a new physical resource; hence creating one.
my-stack |  0/19 | 4:47:32 PM | UPDATE_FAILED        | AWS::ElasticLoadBalancingV2::LoadBalancer   | ApplicationLoadBalancer (ApplicationLoadBalancerFD56DEE1) Resource handler returned message: "Resource of type 'AWS::ElasticLoadBalancingV2::LoadBalancer' with identifier 'my-lb' already exists." (RequestToken: ..., HandlerErrorCode: AlreadyExists)

Is it not possible to update the LB when altering this property? I'm wondering why CF doesn't drop the old LB and create the new one "for me". I have to go tear down the stack and re-deploy it.


Solution

  • Yes according to the AWS documentation for elastic load balancers, changing the Scheme requires replacement.

    Scheme

    Required: No

    Type: String

    Allowed values: internet-facing | internal

    Update requires: Replacement