Skip to main content

πŸ“ AWS EC2 Auto Scaling Group and Classic Load Balancer AZs are inconsistent 🟠🟒

  • Contextual name: πŸ“ Auto Scaling Group and Classic Load Balancer AZs are inconsistent 🟠🟒
  • ID: /ce/ca/aws/autoscaling/group-and-classic-lb-inconsistent-azs
  • Located in: πŸ“ AWS Auto Scaling

Flags​

Our Metadata​

  • Policy Type: COMPLIANCE_POLICY
  • Policy Category:
    • PERFORMANCE
    • COST

Logic​

Internal Notes πŸŸ β€‹

Open File

Below is the relationship between ASG and other types of ELB (except Classic LB).

Currently we cannot compare AGS AZ and ELB AZ in case it's not Classic LB because then it's a related list inside of a related list.

ASG -> Target Group Link.Target Group -> Load Balancer Link.(Application)Load Balancer

  - relationshipName: "CA10__AWS_EC2_Auto_Scaling_Group_ELB_TG_Links__r"
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "LB TG is incompliant."
check:
RELATED_LIST_HAS:
status: "INCOMPLIANT"
relationshipName: "CA10__targetGroup__r.CA10__AWS_EC2_Load_Balancer_Target_Group_Links__r"
otherwise:
status: "COMPLIANT"
currentStateMessage: "TG LB is compliant."
relatedLists:
- relationshipName: "CA10__targetGroup__r.CA10__AWS_EC2_Load_Balancer_Target_Group_Links__r"
importExtracts:
- file: /types/CA10__CaAwsLoadBalancer__c/object.extracts.yaml
conditions:
- status: "INCOMPLIANT"
currentStateMessage: "LB AZ is incompliant."

... [see more](internal.md)

Description​

Open File

Description​

Ensure that AWS Auto Scaling Groups (ASGs) and their associated Classic Load Balancers (CLBs) are configured to use the same Availability Zones (AZs). Aligning AZs between ASGs and CLBs helps to optimize network performance, allowing applications to fully utilize AWS’s low-latency links.

Rationale​

Aligning ASGs and CLBs within the same Availability Zones improves the efficiency and responsiveness of auto-scaling applications. When ASGs and CLBs share the same AZs, load balancers can route traffic within the same zone to instances as they scale, reducing latency, enhancing failover capabilities, and minimizing cross-AZ data transfer costs. This configuration also contributes to better application availability and consistent performance, particularly during high-demand periods or when recovering from failures.

Audit​

This policy will mark an Auto Scaling Group as INCOMPLIANT if its configured Availability Zones do not match Availability Zones of the associated Classic Load Balancer which is identifies via AWS EC2 Auto Scaling Group Tfc.Src.Links object.

Remediation​

Open File

Remediation​

From Command Line​

Update the Availability Zones for the Auto Scaling Group​

Use the update-auto-scaling-group command to modify the Availability Zones for your ASG:

aws autoscaling update-auto-scaling-group \
--auto-scaling-group-name {{your-auto-scaling-group-name}} \
--availability-zones {{AZ1}} {{AZ2}}

Replace {{your-auto-scaling-group-name}} with the name of your ASG and {{AZ1}}, {{AZ2}}, etc., with the list of Availability Zones you want to include.

Update the Availability Zones for the Classic Load Balancer​

Use the enable-availability-zones-for-load-balancer command to add Availability Zones to your CLB. Similarly, use disable-availability-zones-for-load-balancer to remove any unnecessary zones.

Enabling Availability Zones​
aws elb enable-availability-zones-for-load-balancer \
--load-balancer-name {{your-load-balancer-name}} \
--availability-zones {{AZ1}} {{AZ2}}
Disabling Availability Zones (if needed)​
aws elb disable-availability-zones-for-load-balancer \

... [see more](remediation.md)

policy.yaml​

Open File

Linked Framework Sections​

SectionSub SectionsInternal RulesPoliciesFlags
πŸ’Ό Cloudaware Framework β†’ πŸ’Ό Performance Tuning3
πŸ’Ό Cloudaware Framework β†’ πŸ’Ό Resource Optimization3