π 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β
- π’ Policy with categories
- π Policy with internal.md
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
PERFORMANCE
COST
Logicβ
- π§ prod.logic.yaml π’
Internal Notes π β
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β
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 configuredAvailability Zones
do not matchAvailability Zones
of the associated Classic Load Balancer which is identifies via AWS EC2 Auto Scaling Group Tfc.Src.Links object.
Remediationβ
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, usedisable-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β
Linked Framework Sectionsβ
Section | Sub Sections | Internal Rules | Policies | Flags |
---|---|---|---|---|
πΌ Cloudaware Framework β πΌ Performance Tuning | 3 | |||
πΌ Cloudaware Framework β πΌ Resource Optimization | 3 |