π‘οΈ AWS EC2 Auto Scaling Group does not span multiple Availability Zonesπ’
- Contextual name: π‘οΈ Auto Scaling Group does not span multiple Availability Zonesπ’
- ID:
/ce/ca/aws/autoscaling/group-multiple-az - Tags:
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
- Policy Type:
COMPLIANCE_POLICY - Policy Categories:
RELIABILITY
Logicβ
- π§ prod.logic.yamlπ’
Descriptionβ
Descriptionβ
This policy identifies AWS EC2 Auto Scaling Groups (ASGs) that are not configured to launch instances across multiple Availability Zones (AZs).
Rationaleβ
Configuring an Auto Scaling Group to operate across multiple Availability Zones is a key best practice for ensuring high availability and fault tolerance. By distributing instances across multiple AZs, you minimize the risk of downtime caused by failures in a single zone, helping maintain application continuity during infrastructure disruptions.
Impactβ
If an Auto Scaling Group is restricted to a single Availability Zone, any outage within that zone, such as power failures, network disruptions, or natural disasters, can render all instances in the group unavailable, leading to potential service interruptions.
When modifying the number of Availability Zones for an Auto Scaling Group, ensure that the associated load balancer is also updated to reflect the new zone configuration.
Auditβ
This policy flags an AWS EC2 Auto Scaling Group as
INCOMPLIANTif it is configured with fewer than twoAvailability Zones.
Remediationβ
Remediationβ
Change Availability Zonesβ
From Command Lineβ
To configure your Auto Scaling Group to span multiple Availability Zones, update it with subnets that belong to different AZs using the
update-auto-scaling-groupcommand:aws autoscaling update-auto-scaling-group \
--auto-scaling-group-name {{asg-name}} \
--vpc-zone-identifier "subnet-xxxxxxxx,subnet-yyyyyyyy,subnet-zzzzzzzz"After updating the Auto Scaling Group, ensure the associated load balancer is also configured to use subnets from multiple Availability Zones:
aws elbv2 set-subnets \
--load-balancer-arn {{lb-arn}} \
--subnets "subnet-xxxxxxxx" "subnet-yyyyyyyy" "subnet-zzzzzzzz"