Referensi acara Auto Scaling Amazon EC2 - EC2Auto Scaling Amazon

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

Referensi acara Auto Scaling Amazon EC2

Menggunakan Amazon EventBridge, Anda dapat membuat aturan yang cocok dengan peristiwa yang masuk dan merutekkannya ke target untuk diproses.

Peristiwa tindakan siklus hidup

Saat menambahkan kait siklus hidup ke grup Auto Scaling, Auto Scaling Amazon EC2 akan mengirimkan peristiwa saat instance bertransisi EventBridge ke status tunggu. Acara diproduksi atas dasar upaya terbaik.

Tindakan siklus hidup penskalaan

Contoh peristiwa berikut menunjukkan bahwa Auto Scaling Amazon EC2 memindahkan instance ke status karena Pending:Wait hook siklus hidup peluncuran.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Instance-launch Lifecycle Action", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn" ], "detail": { "LifecycleActionToken": "87654321-4321-4321-4321-210987654321", "AutoScalingGroupName": "my-asg", "LifecycleHookName": "my-lifecycle-hook", "EC2InstanceId": "i-1234567890abcdef0", "LifecycleTransition": "autoscaling:EC2_INSTANCE_LAUNCHING", "NotificationMetadata": "additional-info", "Origin": "EC2", "Destination": "AutoScalingGroup" } }

Tindakan siklus hidup skala dalam

Contoh peristiwa berikut menunjukkan bahwa Auto Scaling Amazon EC2 memindahkan instance ke status karena hook Terminating:Wait siklus hidup penghentian.

penting

Saat grup Auto Scaling mengembalikan instance ke kolam hangat dalam skala, mengembalikan instance ke kolam hangat juga dapat menghasilkan peristiwa. EC2 Instance-terminate Lifecycle Action Peristiwa yang dikirimkan saat instance pindah ke status tunggu pada skala memiliki WarmPool nilai untukDestination. Untuk informasi selengkapnya, lihat Instance reuse policy.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Instance-terminate Lifecycle Action", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn" ], "detail": { "LifecycleActionToken":"87654321-4321-4321-4321-210987654321", "AutoScalingGroupName":"my-asg", "LifecycleHookName":"my-lifecycle-hook", "EC2InstanceId":"i-1234567890abcdef0", "LifecycleTransition":"autoscaling:EC2_INSTANCE_TERMINATING", "NotificationMetadata":"additional-info", "Origin": "AutoScalingGroup", "Destination": "EC2" } }

Acara penskalaan yang sukses

Contoh berikut menunjukkan jenis acara untuk acara penskalaan yang berhasil. Acara diproduksi atas dasar upaya terbaik.

Acara scale-out yang sukses

Contoh peristiwa berikut menunjukkan bahwa Amazon EC2 Auto Scaling berhasil meluncurkan instans.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Instance Launch Successful", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn", "instance-arn" ], "detail": { "StatusCode": "InProgress", "Description": "Launching a new EC2 instance: i-12345678", "AutoScalingGroupName": "my-asg", "ActivityId": "87654321-4321-4321-4321-210987654321", "Details": { "Availability Zone": "us-west-2b", "Subnet ID": "subnet-12345678" }, "RequestId": "12345678-1234-1234-1234-123456789012", "StatusMessage": "", "EndTime": "yyyy-mm-ddThh:mm:ssZ", "EC2InstanceId": "i-1234567890abcdef0", "StartTime": "yyyy-mm-ddThh:mm:ssZ", "Cause": "description-text", "Origin": "EC2", "Destination": "AutoScalingGroup" } }

Acara scale-in yang sukses

Contoh peristiwa berikut menunjukkan bahwa Auto Scaling Amazon EC2 berhasil menghentikan instance.

penting

Saat grup Auto Scaling mengembalikan instance ke kolam hangat dalam skala, mengembalikan instance ke kolam hangat juga dapat menghasilkan peristiwa. EC2 Instance Terminate Successful Peristiwa yang dikirimkan ketika sebuah instance berhasil kembali ke kolam hangat memiliki WarmPool nilai untukDestination. Untuk informasi selengkapnya, lihat Instance reuse policy.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Instance Terminate Successful", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn", "instance-arn" ], "detail": { "StatusCode": "InProgress", "Description": "Terminating EC2 instance: i-12345678", "AutoScalingGroupName": "my-asg", "ActivityId": "87654321-4321-4321-4321-210987654321", "Details": { "Availability Zone": "us-west-2b", "Subnet ID": "subnet-12345678" }, "RequestId": "12345678-1234-1234-1234-123456789012", "StatusMessage": "", "EndTime": "yyyy-mm-ddThh:mm:ssZ", "EC2InstanceId": "i-1234567890abcdef0", "StartTime": "yyyy-mm-ddThh:mm:ssZ", "Cause": "description-text", "Origin": "AutoScalingGroup", "Destination": "EC2" } }

Peristiwa penskalaan yang gagal

Contoh berikut menunjukkan jenis acara untuk peristiwa penskalaan yang gagal. Acara diproduksi atas dasar upaya terbaik.

Acara scale-out yang gagal

Contoh peristiwa berikut menunjukkan bahwa Auto Scaling Amazon EC2 gagal meluncurkan instance.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Instance Launch Unsuccessful", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn", "instance-arn" ], "detail": { "StatusCode": "Failed", "AutoScalingGroupName": "my-asg", "ActivityId": "87654321-4321-4321-4321-210987654321", "Details": { "Availability Zone": "us-west-2b", "Subnet ID": "subnet-12345678" }, "RequestId": "12345678-1234-1234-1234-123456789012", "StatusMessage": "message-text", "EndTime": "yyyy-mm-ddThh:mm:ssZ", "EC2InstanceId": "i-1234567890abcdef0", "StartTime": "yyyy-mm-ddThh:mm:ssZ", "Cause": "description-text", "Origin": "EC2", "Destination": "AutoScalingGroup" } }

Acara scale-in yang gagal

Contoh peristiwa berikut menunjukkan bahwa Auto Scaling Amazon EC2 gagal menghentikan instance.

penting

Ketika grup Auto Scaling mengembalikan instance ke kolam hangat dalam skala, gagal mengembalikan instance ke kolam hangat juga dapat menghasilkan peristiwa. EC2 Instance Terminate Unsuccessful Peristiwa yang dikirimkan ketika sebuah instance gagal kembali ke kolam hangat memiliki WarmPool nilai untukDestination. Untuk informasi selengkapnya, lihat Instance reuse policy.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Instance Terminate Unsuccessful", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn", "instance-arn" ], "detail": { "StatusCode": "Failed", "AutoScalingGroupName": "my-asg", "ActivityId": "87654321-4321-4321-4321-210987654321", "Details": { "Availability Zone": "us-west-2b", "Subnet ID": "subnet-12345678" }, "RequestId": "12345678-1234-1234-1234-123456789012", "StatusMessage": "message-text", "EndTime": "yyyy-mm-ddThh:mm:ssZ", "EC2InstanceId": "i-1234567890abcdef0", "StartTime": "yyyy-mm-ddThh:mm:ssZ", "Cause": "description-text", "Origin": "AutoScalingGroup", "Destination": "EC2" } }

Acara penyegaran contoh

Contoh berikut menunjukkan peristiwa untuk fitur penyegaran instance. Acara diproduksi atas dasar upaya terbaik.

Pos pemeriksaan tercapai

Ketika jumlah instans yang telah diganti mencapai ambang batas persentase yang ditentukan untuk pos pemeriksaan, Auto Scaling Amazon EC2 mengirimkan peristiwa berikut.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Auto Scaling Instance Refresh Checkpoint Reached", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn" ], "detail": { "InstanceRefreshId": "ab00cf8f-9126-4f3c-8010-dbb8cad6fb86", "AutoScalingGroupName": "my-asg", "CheckpointPercentage": "50", "CheckpointDelay": "300" } }

Penyegaran instance dimulai

Saat status penyegaran instans berubahInProgress, Auto Scaling Amazon EC2 akan mengirimkan peristiwa berikut.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Auto Scaling Instance Refresh Started", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn" ], "detail": { "InstanceRefreshId": "c613620e-07e2-4ed2-a9e2-ef8258911ade", "AutoScalingGroupName": "my-asg" } }

Penyegaran instance berhasil

Saat status penyegaran instans berubahSuccessful, Auto Scaling Amazon EC2 akan mengirimkan peristiwa berikut.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Auto Scaling Instance Refresh Succeeded", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn" ], "detail": { "InstanceRefreshId": "c613620e-07e2-4ed2-a9e2-ef8258911ade", "AutoScalingGroupName": "my-asg" } }

Penyegaran instans gagal

Saat status penyegaran instans berubahFailed, Auto Scaling Amazon EC2 akan mengirimkan peristiwa berikut.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Auto Scaling Instance Refresh Failed", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn" ], "detail": { "InstanceRefreshId": "c613620e-07e2-4ed2-a9e2-ef8258911ade", "AutoScalingGroupName": "my-asg" } }

Penyegaran instans dibatalkan

Saat status penyegaran instans berubahCancelled, Auto Scaling Amazon EC2 akan mengirimkan peristiwa berikut.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Auto Scaling Instance Refresh Cancelled", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn" ], "detail": { "InstanceRefreshId": "c613620e-07e2-4ed2-a9e2-ef8258911ade", "AutoScalingGroupName": "my-asg" } }

Rollback penyegaran instance dimulai

Saat status penyegaran instans berubahRollbackInProgress, Auto Scaling Amazon EC2 akan mengirimkan peristiwa berikut.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Auto Scaling Instance Refresh Rollback Started", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn" ], "detail": { "InstanceRefreshId": "c613620e-07e2-4ed2-a9e2-ef8258911ade", "AutoScalingGroupName": "my-asg" } }

Rollback penyegaran instans berhasil

Saat status penyegaran instans berubahRollbackSuccessful, Auto Scaling Amazon EC2 akan mengirimkan peristiwa berikut.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Auto Scaling Instance Refresh Rollback Succeeded", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn" ], "detail": { "InstanceRefreshId": "c613620e-07e2-4ed2-a9e2-ef8258911ade", "AutoScalingGroupName": "my-asg" } }

Rollback penyegaran instans gagal

Saat status penyegaran instans berubahFailed, Auto Scaling Amazon EC2 akan mengirimkan peristiwa berikut.

{ "version": "0", "id": "12345678-1234-1234-1234-123456789012", "detail-type": "EC2 Auto Scaling Instance Refresh Rollback Failed", "source": "aws.autoscaling", "account": "123456789012", "time": "yyyy-mm-ddThh:mm:ssZ", "region": "us-west-2", "resources": [ "auto-scaling-group-arn" ], "detail": { "InstanceRefreshId": "c613620e-07e2-4ed2-a9e2-ef8258911ade", "AutoScalingGroupName": "my-asg" } }