How to Fix CloudFormation error “Provided Load Balancers may not be valid. Please ensure they exist and try again

Question:

when I try to create Autoscale group with Application load balancer with the following cloudformation yml file

I got an error saying “Provided Load Balancers may not be valid. Please ensure they exist and try again. (Service: AmazonAutoScaling; Status Code: 400; Error Code: ValidationError; Request ID:)”

Answer:

this error is happening because you used LoadBalancerNames for Application loadbalancer as it is noted here

to fix it : remove the LoadBalancerNames and keep TargetGroupARNs in the properties

LoadBalancerNames:
– Ref: “LoadBalancer”

so the yml file will be like :

Leave a Reply