Auto Scaling group has no ELB group

ID

aws_ec2_asg_without_elb

Severity

low

Vendor

AWS

Resource

Other

Tags

non-reachable

Description

Auto Scaling Groups must have associated ELBs to ensure high availability and improve application performance.

To fix it, you must configure load_balancers with no empty list.

Learn more about this topic at AWS attach ELB to ASG.

Examples

---
- name: Example playbook
  hosts: localhost
  tasks:
    - amazon.aws.autoscaling_group:
        name: special
        availability_zones: [ 'eu-west-1a', 'eu-west-1b' ]
        launch_config_name: 'lc-1'
        min_size: 1
        max_size: 10
        desired_capacity: 5
        vpc_zone_identifier: [ 'subnet-abcd1234', 'subnet-1a2b3c4d' ]
        tags:
          - environment: production
            propagate_at_launch: false

Mitigation / Fix

---
- name: Example playbook
  hosts: localhost
  tasks:
    - amazon.aws.autoscaling_group:
        name: special
        load_balancers: [ 'lb1', 'lb2' ]
        availability_zones: [ 'eu-west-1a', 'eu-west-1b' ]
        launch_config_name: 'lc-1'
        min_size: 1
        max_size: 10
        desired_capacity: 5
        vpc_zone_identifier: [ 'subnet-abcd1234', 'subnet-1a2b3c4d' ]
        tags:
          - environment: production
            propagate_at_launch: false