All Products
Search
Document Center

:Auto Scaling events

最終更新日:Sep 29, 2024

This topic describes the types of Auto Scaling events that ActionTrail records or CloudMonitor or Cloud Config monitors and can be published to EventBridge.

Event types

The following table describes the types of Auto Scaling events that can be published to EventBridge.

Event type

Value of the type parameter

A scale-in activity failed

ess:ScalingActivity:ScaleInError

A scale-in activity is partially successful

ess:ScalingActivity:ScaleInPartialSuccess

A scale-in activity is successful

ess:ScalingActivity:ScaleInSuccess

A scale-out activity failed

ess:ScalingActivity:ScaleOutError

A scale-out activity is partially successful

ess:ScalingActivity:ScaleOutPartialSuccess

A scale-out activity is successful

ess:ScalingActivity:ScaleOutSuccess

A lifecycle hook for a scale-in activity is triggered

ess:LifecycleHook:ScaleIn

A lifecycle hook for a scale-out activity is triggered

ess:LifecycleHook:ScaleOut

A lifecycle hook test for EventBridge is triggered

ess:LifecycleHook:Test

A scale-in activity starts

ess:ScalingActivity:ScaleInStart

A scale-out activity starts

ess:ScalingActivity:ScaleOutStart

An operation is performed on a resource

ess:ActionTrail:AliyunServiceEvent

An API operation is called

ess:ActionTrail:ApiCall

An operation is performed in the console

ess:ActionTrail:ConsoleOperation

The scale-in activity of a scaling group failed

ess:CloudMonitor:AUTOSCALING[SCALEINERROR]

The scale-in activity of a scaling group starts

ess:CloudMonitor:AUTOSCALING[SCALEINSTART]

The scale-in activity of a scaling group is successful

ess:CloudMonitor:AUTOSCALING[SCALEINSUCCESS]

The scale-in activity of a scaling group is partially successful

ess:CloudMonitor:AUTOSCALING[SCALEINWARN]

The scale-out activity of a scaling group failed

ess:CloudMonitor:AUTOSCALING[SCALEOUTERROR]

The scale-out activity of a scaling group starts

ess:CloudMonitor:AUTOSCALING[SCALEOUTSTART]

The scale-out activity of a scaling group is successful

ess:CloudMonitor:AUTOSCALING[SCALEOUTSUCCESS]

The scale-out activity of a scaling group is partially successful

ess:CloudMonitor:AUTOSCALING[SCALEOUTWARN]

The scaling activity of a scaling group is rejected

ess:CloudMonitor:AUTOSCALING[SCALEREJECT]

A scheduled task expires

ess:CloudMonitor:AUTOSCALING[SCHEDULETASKEXPIRING]

Resource change logs are delivered

ess:Config:ConfigurationItemChangeNotification

A notification that indicates a resource is evaluated as non-compliant is delivered

ess:Config:NonCompliantNotification

For more information about the parameters defined in the CloudEvents specification, see Overview.

A scale-in activity failed

The following example shows the event that EventBridge receives when a scale-in activity failed:

{
  "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
  "source": "acs.ess",
  "specversion": "1.0",
  "subject": "arn:acs:ess:cn-hangzhou:123456789xxxxxxx:scalinggroup/asg-xxxxx",
  "time": "2020-11-19T21:04:41Z",
  "type": "ess:ScalingActivity:ScaleInError",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2020-11-19T21:04:42Z",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX",
  "data": {
    "cause": "A user changed the Desired Capacity, changing the Total Capacity from \"1\" to \"0\".",
    "description": "Fail to remove Instances \"i-xxx\" (code:\"LifecycleActionResult.Abandon\", msg:\"Abandon lifecycleActionResult parameter caused the instance to rollback.\").",
    "startTime": "2022-09-06T06:29:23.000Z",
    "endTime": "2022-09-06T06:30:10.000Z",
    "expectNum": 1,
    "requestId": "WOSQ2zMxNTcZOoH1bu****",
    "scalingActivityId": "asa-xxx",
    "totalCapacity": 1
  }
}

The following table describes the parameters contained in the data field.

Field

Type

Example

Description

cause

String

A user changed the Desired Capacity, changing the Total Capacity from \"1\" to \"0\"."

The reason why the scaling activity was triggered.

description

String

Fail to remove Instances \"i-xxx\" (code:\"LifecycleActionResult.Abandon\", msg:\"Abandon lifecycleActionResult parameter caused the instance to rollback.\")."

The description of the scaling activity.

startTime

String

2022-09-06T06:29:23.000Z

The time when the scaling activity started.

endTime

String

2022-09-06T06:30:10.000Z

The time when the scaling activity ended.

expectNum

Int

1

The expected scale-in capacity of the scaling activity.

requestId

String

WOSQ2zMxNTcZOoH1b****

The request ID.

scalingActivityId

String

asa-xxx

The ID of the scaling activity.

totalCapacity

String

1

The capacity of the scaling group after the scaling activity is complete.

A scale-in activity is partially successful

The following example shows the event that EventBridge receives when a scale-in activity is partially successful:

{
  "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
  "source": "acs.ess",
  "specversion": "1.0",
  "subject": "arn:acs:ess:cn-hangzhou:123456789xxxxxxx:scalinggroup/asg-xxxxx",
  "time": "2020-11-19T21:04:41Z",
  "type": "ess:ScalingActivity:ScaleInPartialSuccess",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2020-11-19T21:04:42Z",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX",
  "data": {
    "cause": "A user changed the Desired Capacity, changing the Total Capacity from \"2\" to \"0\".",
    "description": "\"1\" ECS instances are removed",
    "startTime": "2022-09-06T06:29:23.000Z",
    "endTime": "2022-09-06T06:30:10.000Z",
    "expectNum": 1,
    "instanceIds": [
      "i-xxx"
    ],
    "requestId": "WOSQ2zMxNTcZOoH1bu****",
    "scalingActivityId": "asa-xxx",
    "totalCapacity": 1
  }
}

The following table describes the parameters contained in the data field.

Field

Type

Example

Description

cause

String

A user changed the Desired Capacity, changing the Total Capacity from \"1\" to \"0\"."

The reason why the scaling activity was triggered.

description

String

Fail to remove Instances \"i-xxx\" (code:\"LifecycleActionResult.Abandon\", msg:\"Abandon lifecycleActionResult parameter caused the instance to rollback.\")."

The description of the scaling activity.

startTime

String

2022-09-06T06:29:23.000Z

The time when the scaling activity started.

endTime

String

2022-09-06T06:30:10.000Z

The time when the scaling activity ended.

expectNum

Int

1

The expected scale-in capacity of the scaling activity.

requestId

String

WOSQ2zMxNTcZOoH1bu****

The request ID.

scalingActivityId

String

asa-xxx

The ID of the scaling activity.

instanceIds

Array

i-xxx

The IDs of the instances that you want to remove.

totalCapacity

Int

1

The capacity of the scaling group after the scaling activity is complete.

A scale-in activity is successful

The following example shows the event that EventBridge receives when a scale-in activity is successful:

{
  "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
  "source": "acs.ess",
  "specversion": "1.0",
  "subject": "arn:acs:ess:cn-hangzhou:123456789xxxxxxx:scalinggroup/asg-xxxxx",
  "time": "2020-11-19T21:04:41Z",
  "type": "ess:ScalingActivity:ScaleInSuccess",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2020-11-19T21:04:42Z",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX",
  "data": {
    "cause": "A user changed the Desired Capacity, changing the Total Capacity from \"1\" to \"0\".",
    "description": "\"1\" ECS instances are removed",
    "startTime": "2022-09-06T06:29:23.000Z",
    "endTime": "2022-09-06T06:30:10.000Z",
    "expectNum": 1,
    "instanceIds": [
      "i-xxx"
    ],
    "requestId": "WOSQ2zMxNTcZOoH1bu****",
    "scalingActivityId": "asa-xxx",
    "totalCapacity": 0
  }
}

For information about the parameters contained in the data field, see the parameter description table.

A scale-out activity failed

The following example shows the event that EventBridge receives when a scale-out activity failed:

{
  "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
  "source": "acs.ess",
  "specversion": "1.0",
  "subject": "arn:acs:ess:cn-hangzhou:123456789xxxxxxx:scalinggroup/asg-xxxxx",
  "time": "2020-11-19T21:04:41Z",
  "type": "ess:ScalingActivity:ScaleOutError",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2020-11-19T21:04:42Z",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX",
  "data": {
    "cause": "A user changed the Desired Capacity, changing the Total Capacity from \"0\" to \"1\".",
    "description": "Fail to create Instances into scaling group(code:\"LifecycleActionResult.Abandon\", msg:\"Abandon lifecycleActionResult parameter caused the instance to rollback.\").",
    "startTime": "2022-09-06T06:29:23.000Z",
    "endTime": "2022-09-06T06:30:10.000Z",
    "expectNum": 1,
    "requestId": "WOSQ2zMxNTcZOoH1bu****",
    "scalingActivityId": "asa-xxx",
    "totalCapacity": 0
  }
}

For information about the parameters contained in the data field, see the parameter description table.

A scale-out activity is partially successful

The following example shows the event that EventBridge receives when a scale-out activity is partially successful:

{
  "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
  "source": "acs.ess",
  "specversion": "1.0",
  "subject": "arn:acs:ess:cn-hangzhou:123456789xxxxxxx:scalinggroup/asg-xxxxx",
  "time": "2020-11-19T21:04:41Z",
  "type": "ess:ScalingActivity:ScaleOutPartialSuccess",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2020-11-19T21:04:42Z",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX",
  "data": {
    "cause": "A user changed the Desired Capacity, changing the Total Capacity from \"0\" to \"2\".",
    "description": "\"1\" ECS instances are added",
    "startTime": "2022-09-06T06:29:23.000Z",
    "endTime": "2022-09-06T06:30:10.000Z",
    "expectNum": 2,
    "instanceIds": [
      "i-xxx"
    ],
    "requestId": "WOSQ2zMxNTcZOoH1bu****",
    "scalingActivityId": "asa-xxx",
    "totalCapacity": 1
  }
}

For information about the parameters contained in the data field, see the parameter description table.

A scale-out activity is successful

The following example shows the event that EventBridge receives when a scale-out activity is successful:

{
  "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
  "source": "acs.ess",
  "specversion": "1.0",
  "subject": "arn:acs:ess:cn-hangzhou:123456789xxxxxxx:scalinggroup/asg-xxxxx",
  "time": "2020-11-19T21:04:41Z",
  "type": "ess:ScalingActivity:ScaleOutSuccess",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2020-11-19T21:04:42Z",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX",
  "data": {
    "cause": "A user changed the Desired Capacity, changing the Total Capacity from \"0\" to \"1\".",
    "description": "\"1\" ECS instances are added",
    "startTime": "2022-09-06T06:29:23.000Z",
    "endTime": "2022-09-06T06:30:10.000Z",
    "expectNum": 1,
    "instanceIds": [
      "i-xxx"
    ],
    "requestId": "WOSQ2zMxNTcZOoH1bu****",
    "scalingActivityId": "asa-xxx",
    "totalCapacity": 1
  }
}

For information about the parameters contained in the data field, see the parameter description table.

A lifecycle hook for a scale-in activity is triggered

The following example shows the event that EventBridge receives when a lifecycle hook for a scale-in activity is triggered:

{
  "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
  "source": "acs.ess",
  "specversion": "1.0",
  "subject": "arn:acs:ess:cn-hangzhou:123456789xxxxxxx:scalinggroup/asg-xxxxx",
  "time": "2023-05-19T21:04:41Z",
  "type": "ess:LifecycleHook:ScaleIn",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2023-05-19T21:04:42Z",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX",
  "data": {
    "instanceIds": [
      "i-xxx"
    ],
    "lifecycleHookId": "ash-xxx",
    "lifecycleActionToken": "XXXX",
    "scalingGroupId": "asg-xxx",
    "scalingActivityId": "asa-xxx",
    "notificationMetadata": "lifecycleHook metadata example",
    "defaultResult": "CONTINUE"
  }
}

The following table describes the parameters contained in the data field.

Field

Type

Example

Description

instanceIds

Array

[ "i-xxx" ]

The IDs of the instances that you want to remove.

lifecycleHookId

String

ash-xxx

The ID of the lifecycle hook.

lifecycleActionToken

String

XXXX

The action token of the lifecycle hook.

scalingGroupId

String

asg-xxx

The ID of the scaling group.

scalingActivityId

String

asa-xxx

The ID of the scaling activity.

notificationMetadata

String

lifecycleHook metadata example

The notification that is sent when the lifecycle hook takes effect.

defaultResult

String

CONTINUE

The default result of the lifecycle hook. Valid values:

  • CONTINUE: Auto Scaling continues to respond to scale-in or scale-out requests.

  • ABANDON: Auto Scaling releases Elastic Compute Service (ECS) instances during scale-out events, or removes ECS instances from the scaling group during scale-in events.

  • ROLLBACK: During scale-in events, Auto Scaling declines requests to release ECS instances and rolls back changes. During scale-out events, the ROLLBACK setting behaves identically to the ABANDON setting.

A lifecycle hook for a scale-out activity is triggered

The following example shows the event that EventBridge receives when a lifecycle hook for a scale-out activity is triggered:

{
  "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
  "source": "acs.ess",
  "specversion": "1.0",
  "subject": "arn:acs:ess:cn-hangzhou:123456789xxxxxxx:scalinggroup/asg-xxxxx",
  "time": "2023-05-19T21:04:41Z",
  "type": "ess:LifecycleHook:ScaleOut",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2023-05-19T21:04:42Z",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX",
  "data": {
    "instanceIds": [
      "i-xxx"
    ],
    "lifecycleHookId": "ash-xxx",
    "lifecycleActionToken": "XXXX",
    "scalingGroupId": "asg-xxx",
    "scalingActivityId": "asa-xxx",
    "notificationMetadata": "lifecycleHook metadata example",
    "defaultResult": "CONTINUE"
  }
}

For information about the parameters contained in the data field, see the parameter description table.

A lifecycle hook test for EventBridge is triggered

The following example shows the event that EventBridge receives when a lifecycle hook test for EventBridge is triggered:

{
  "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
  "source": "acs.ess",
  "specversion": "1.0",
  "subject": "arn:acs:ess:cn-hangzhou:123456789xxxxxxx:scalinggroup/asg-xxxxx",
  "time": "2023-05-19T21:04:41Z",
  "type": "ess:LifecycleHook:Test",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2023-05-19T21:04:42Z",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX",
  "data": {
    "scalingGroupId": "asg-xxx"
  }
}

For information about the parameters contained in the data field, see the parameter description table.

A scale-in activity starts

The following example shows the event that EventBridge receives when a scale-in activity starts:

{
  "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
  "source": "acs.ess",
  "specversion": "1.0",
  "subject": "arn:acs:ess:cn-hangzhou:123456789xxxxxxx:scalinggroup/asg-xxxxx",
  "time": "2020-11-19T21:04:41Z",
  "type": "ess:ScalingActivity:ScaleInStart",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2020-11-19T21:04:42Z",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX",
  "data": {
    "cause": "A user changed the Desired Capacity, changing the Total Capacity from \"1\" to \"0\".",
    "description": "\"1\" ECS instances are removed",
    "startTime": "2022-09-06T06:29:23.000Z",
    "expectNum": 1,
    "requestId": "WOSQ2zMxNTcZOoH1bu****",
    "scalingActivityId": "asa-xxx",
    "totalCapacity": 1
  }
}

The following table describes the parameters contained in the data field.

Field

Type

Example

Description

cause

string

A user changed the Desired Capacity, changing the Total Capacity from \"1\" to \"0\".

The reason why the scaling activity was triggered.

description

string

\"1\" ECS instances are removed"

The description of the scaling activity.

startTime

string

2022-09-06T06:29:23.000Z

The time when the scaling activity started.

expectNum

Int

1

The expected scale-in capacity of the scaling activity.

requestId

string

WOSQ2zMxNTcZOoH1bu****

The request ID of the scaling activity.

scalingActivityId

string

asa-xxx

The ID of the scaling activity.

totalCapacity

Int

1

The capacity of the scaling group after the scaling activity is complete.

A scale-out activity starts

The following example shows the event that EventBridge receives when a scale-out activity starts:

{
  "id": "45ef4dewdwe1-7c35-447a-bd93-fab****",
  "source": "acs.ess",
  "specversion": "1.0",
  "subject": "arn:acs:ess:cn-hangzhou:123456789xxxxxxx:scalinggroup/asg-xxxxx",
  "time": "2020-11-19T21:04:41Z",
  "type": "ess:ScalingActivity:ScaleOutStart",
  "aliyunaccountid": "123456789098****",
  "aliyunpublishtime": "2020-11-19T21:04:42Z",
  "aliyuneventbusname": "default",
  "aliyunregionid": "cn-hangzhou",
  "aliyunpublishaddr": "172.25.XX.XX",
  "data": {
    "cause": "A user changed the Desired Capacity, changing the Total Capacity from \"0\" to \"2\".",
    "description": "\"1\" ECS instances are added",
    "startTime": "2022-09-06T06:29:23.000Z",
    "expectNum": 2,
    "requestId": "WOSQ2zMxNTcZOoH1bu****",
    "scalingActivityId": "asa-xxx",
    "totalCapacity": 1
  }
}

For information about the parameters contained in the data field, see the parameter description table.