Expert AWS Auto Scaling Groups Configuration

Peak loads can lead to downtime and overspending if infrastructure doesn't scale automatically. We configure Auto Scaling Groups in AWS to keep your application stable under any user surge. Our team delivers a turnkey project—from auditing your current configuration to implementation and ongoing support.

Our competencies:

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1359
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1330
  • B2B Advance company logo design
    B2B Advance company logo design
    776
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1077
  • AIDER company logo development
    AIDER company logo development
    1022
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1113

We configure Auto Scaling Groups in AWS so your application can handle peak loads without downtime or overpaying. Misconfiguration can cost tens of thousands of dollars per month or cause hours of outage. Properly setting up ASG with predictive scaling and a Mixed Instance Policy reduces costs by 60–70%. With over 50 successful scaling projects behind us, certified engineers, and a guarantee of results, we're your go-to partner.

Here's a typical story: an ASG configured with a CPU-based policy. Load increases, CPU hits 70%, ASG launches a new instance. It takes 5 minutes to start and another 3 for health checks — 8 minutes total before the new instance serves traffic. By then, CPU on existing instances has long passed 90%, and users see timeouts.

The solution lies in predictive scaling and proper warm-up configuration. Let's dive in.

Launch Templates Instead of Launch Configurations

Launch Configurations are legacy. For years, AWS has officially recommended Launch Templates for all new deployments. Launch Templates support versioning (so you can roll back), Mixed Instance Policies (combining different instance types in one ASG), T-instance unlimited mode, and other new features.

Example Launch Template via Terraform
resource "aws_launch_template" "app" {
  name_prefix = "myapp-"
  image_id = data.aws_ami.app.id
  instance_type = "t3.medium"
  iam_instance_profile {
    name = aws_iam_instance_profile.app.name
  }
  user_data = base64encode(templatefile("${path.module}/userdata.sh", {
    environment = var.environment
  }))
  tag_specifications {
    resource_type = "instance"
    tags = {
      Name = "myapp-${var.environment}"
    }
  }
  lifecycle {
    create_before_destroy = true
  }
}

Which Scaling Policies to Choose?

Target Tracking is the simplest and most recommended. You specify a target metric value, and ASG automatically calculates how many instances are needed. For CPU target 50%, ASG keeps average CPU around 50% by adding or removing instances.

resource "aws_autoscaling_policy" "cpu_target" {
  name = "cpu-target-tracking"
  autoscaling_group_name = aws_autoscaling_group.app.name
  policy_type = "TargetTrackingScaling"
  target_tracking_configuration {
    predefined_metric_specification {
      predefined_metric_type = "ASGAverageCPUUtilization"
    }
    target_value = 50.0
  }
}

Step Scaling gives more precise control. Different scaling steps based on how far the metric exceeds the threshold. CPU 60–75% → add 1 instance, CPU 75–90% → add 3 instances, CPU >90% → add 5 instances.

Scheduled Scaling for predictable peaks. Combining these approaches yields optimal load response.

Policy Type When to Use Benefits
Target Tracking Typical web workloads Simplicity, automatic adjustment
Step Scaling Uneven peaks with criticality Flexibility, precise control
Scheduled Scaling Predictable events (business hours, promotions) Resources ready before peak starts

How to Set Up Health Check Grace Period?

ASG checks instance health via EC2 status checks or ALB health checks. ALB health checks are best for web services: they test real application responses, not just hypervisor availability.

health_check_grace_period is the time ASG gives a new instance to initialize before starting health checks. If too short, the instance will be marked unhealthy before the app starts and ASG will terminate it. If too long, a truly broken instance stays in rotation.

For applications with long cold starts (Spring Boot, JVM) — grace period 300–600 seconds. For lightweight Go/Node services — 60–120 seconds.

Why Lifecycle Hooks Are Critical for Deployments

Lifecycle Hooks let you perform actions during instance launch or termination, pausing the ASG process until the hook completes. According to AWS Lifecycle Hooks documentation, you can:

  • autoscaling:EC2_INSTANCE_LAUNCHING: wait for full application initialization, register in consul/etcd, load configuration from S3.
  • autoscaling:EC2_INSTANCE_TERMINATING: wait for current requests to finish, deregister from service discovery, send final metrics.

Without a terminating hook on scale-in, ALB is told to remove the instance from rotation, but ASG kills the instance after 30 seconds. Active connections are dropped. With a hook, the instance first drains connections (up to 5 minutes), then signals the hook to complete.

How to Save with Mixed Instance Policy?

To reduce costs, use a Mixed Instance Policy: part capacity on On-Demand (base), the rest on Spot. Spot instances can be 10 times cheaper than On-Demand when you choose the right strategy. For example, one of our clients reduced their monthly AWS bill from $12,000 to $3,600 by moving to a mixed policy with 80% Spot instances.

mixed_instances_policy {
  instances_distribution {
    on_demand_base_capacity = 1
    on_demand_percentage_above_base_capacity = 20
    spot_allocation_strategy = "price-capacity-optimized"
  }

  launch_template {
    launch_template_specification {
      launch_template_id = aws_launch_template.app.id
      version = "$Latest"
    }

    override {
      instance_type = "t3.medium"
    }

    override {
      instance_type = "t3a.medium"
    }

    override {
      instance_type = "t2.medium"
    }
  }
}

The price-capacity-optimized strategy selects Spot instances from pools with the highest availability and lowest price, reducing interruption risk. Auto Scaling cost optimization is achieved through such mixed policies. Spot instances autoscaling can be configured with this strategy for fault-tolerant workloads.

Feature On-Demand Spot (Mixed Instance Policy)
Price 100% up to 10% of On-Demand
Availability guarantee 99.99% up to 99.5% (varies by type)
Interruption no possible under high demand
Usage critical services fault-tolerant, batch, stateless

How to Configure an Auto Scaling Group: Step-by-Step

  1. Create a Launch Template with AMI, instance type, user data, and tags.
  2. Create an Auto Scaling Group, choose the Launch Template, and specify VPC and subnets.
  3. Configure a scaling policy: Target Tracking for CPU or Request Count.
  4. Attach an ALB and set health check grace period (300–600 s for heavy apps).
  5. Add Lifecycle Hooks for graceful shutdown (EC2_INSTANCE_TERMINATING).
  6. Set up a Mixed Instance Policy for savings.
  7. Test scaling with load testing.

What's Included (Deliverables)

  • Audit of current ASG configuration with recommendations
  • Design of Launch Templates with security and user data
  • Configuration of one or more scaling policies (target tracking, step, scheduled)
  • Integration with ALB and health check tuning
  • Implementation of Lifecycle Hooks for graceful shutdown
  • Mixed Instance Policy for cost optimization
  • Monitoring (CloudWatch, Prometheus) and alerts
  • Documentation and team training
  • Access to your AWS account for ongoing monitoring
  • 1-month support and handover of credentials
  • 1-month guarantee on settings

Timeline and Cost

Basic ASG setup with target tracking policy and ALB integration — from 1 day. Full turnkey configuration with lifecycle hooks, mixed instances, scheduled scaling, and monitoring — 2–4 days. Pricing is determined individually after analyzing your infrastructure.

Contact us for a project assessment. We'll evaluate your current ASG configuration and show you how to save up to 70% on cloud costs. Get a consultation from an AWS engineer with 7+ years of experience. We guarantee your scaling will be reliable, cost-effective, and manageable.