Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

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

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

    LoadBalancer: 
      Type: AWS::ElasticLoadBalancingV2::LoadBalancer
      Properties: 
        Type: application
        Subnets: 
          Ref: VPCZoneIdentifier  

    AutoScalingGroup:
      Type: AWS::AutoScaling::AutoScalingGroup
      DependsOn: LoadBalancer
      Properties:
        AvailabilityZones: 
          Ref: "AvailabilityZones"
        Cooldown: 120
        DesiredCapacity:
          Ref: DesiredCapacityASG
        LaunchConfigurationName: 
          Ref: LaunchConfiguration
        MaxSize:
          Ref: MaxSizeASG
        MinSize:
          Ref: MinSizeASG
        LoadBalancerNames: 
          - Ref: "LoadBalancer"
        TargetGroupARNs:
          - !Ref TargetGroup

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:)"

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

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 :

    AutoScalingGroup:
      Type: AWS::AutoScaling::AutoScalingGroup
      DependsOn: LoadBalancer
      Properties:
        AvailabilityZones: 
          Ref: "AvailabilityZones"
        Cooldown: 120
        DesiredCapacity:
          Ref: DesiredCapacityASG
        LaunchConfigurationName: 
          Ref: LaunchConfiguration
        MaxSize:
          Ref: MaxSizeASG
        MinSize:
          Ref: MinSizeASG
        TargetGroupARNs:
          - !Ref TargetGroup
over 4 years ago · Santiago Trujillo Report

0

If you are using ansible ec2_asg module and reached here, replace load_balancers: with target_group_arns and pass the ARN of the Target Group.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!