DaaS / Products / Auto Scaling Event Delivery Pipeline

Auto Scaling Event Delivery Pipeline

Set up an Auto Scaling group integrated with SLB and RDS for a scalable application tier, then configure EventBridge to capture scaling activity events and deliver them to external monitoring APIs, an OSS bucket for audit logging, or an MQTT broker for real-time alerting.

Products involved

Scenario

Developers need this pipeline when deploying stateless application tiers requiring dynamic capacity adjustments via Auto Scaling (ESS) while maintaining strict observability. By integrating ESS with SLB and RDS, and routing scaling lifecycle events through EventBridge (EB), teams can trigger external monitoring webhooks, archive audit logs in OSS, or push real-time alerts to MQTT brokers without custom polling scripts.

Integration steps

  1. Bind SLB & RDS to Scaling Group: Use CreateScalingGroup with LoadBalancerIds and DBInstanceIds to attach infrastructure during initial configuration.
  2. aliyun ess CreateScalingGroup --ScalingGroupName "app-tier" --VpcId "vpc-xxx" --LoadBalancerIds '["lb-xxx"]' --DBInstanceIds '["rm-xxx"]'

  3. Define Scaling Triggers: Create CreateScalingRule and attach to CloudMonitor via CreateAlarmTask to automate capacity changes.
  4. Provision EventBridge Bus: Isolate scaling telemetry with CreateEventBus --EventBusName "ess-scaling-events".
  5. Capture ESS Events: Use PutRule with an event pattern filtering scaling outcomes:
  6. {"source":["acs.ess"],"detail-type":["Scaling Activity Status Change"],"detail":{"ScalingActivityStatus":["Success","Failed"]}}

  7. Configure API Destination: Route to external monitoring using Bearer Token auth:
  8. aliyun eventbridge CreateApiDestination --Name "monitor-webhook" --Endpoint "https://api.monitor.io/hooks" --AuthParameters '{"Type":"BearerToken","BearerTokenParameters":{"Token":"${API_KEY}"}}'

  9. Add OSS & MQTT Targets: Attach Target configurations to the rule pointing to acs:oss:::audit-bucket and acs:mqtt:::broker-id.
  10. Validate Pipeline: Execute ExecuteScalingRule and verify delivery via EB console metrics or DescribeEventBus.

Architecture

ESS manages instance lifecycle, automatically registering ECS nodes with the SLB server group and updating RDS whitelists. ESS emits structured lifecycle events to the Alibaba Cloud event bus. EventBridge intercepts these events using pattern-matching rules, applies optional transformations, and reliably routes payloads to configured targets: HTTP API Destinations for real-time monitoring, OSS for immutable audit logs, and MQTT brokers for edge alerting. EB handles retries, dead-letter queues, and authentication, fully decoupling scaling logic from downstream consumers.

Prerequisites

Common pitfalls

Typical questions

FAQ

Q: How do I deliver Auto Scaling events to external destinations using EventBridge? A: EventBridge captures scaling activity events and delivers them to external monitoring APIs, an OSS bucket for audit logging, or an MQTT broker for real-time alerting. This configuration combines Auto Scaling integration with external services and EventBridge destination delivery to route the events accordingly.