RealtimeAlertEvent

Notifies subscribers of Amazon CloudWatch alarm events from your Service Cloud Voice Amazon Connect instance. This object is available in API version 54.0 and later.

Supported Calls

describeSObjects()

Supported Subscribers

Subscriber Supported?
Apex Triggers Yes
Flows Yes
Processes Yes
Pub/Sub API Yes
Streaming API (CometD) Yes

Subscription Channel

/event/RealtimeAlertEvent

Special Access Rules

Accessing this object requires Service Cloud Voice with Amazon Connect enabled.

Event Delivery Allocation Enforced

Yes

Fields

Description

Type: string

Properties: None

Description: Required. Description of the alert fired.

EventDateTime

Type: datetime

Properties: None

Description: Date and time when the alert occurred. For example: 2020-12-18 21:59:48.

Name

Type: string

Properties: None

Description: Required. Name of the alert fired.

Payload

Type: string

Properties: None

Description: More information and data associated with the alert.

Severity

Type: string

Properties: None

Description: Required. Severity of the triggered alarm. Possible values: Values are Critical, Warning, or Information. When using Amazon CloudWatch with Service Cloud Voice, the following alarm states map to severity values: Values are ALARM maps to Critical, INSUFFICIENT_DATA maps to Warning, or OK maps to Information.

Source

Type: string

Properties: None

Description: Required. The source of the alert. For example, this value can be the service name: AWS Cloudwatch.

Usage

The following example shows how to process RealtimeAlert events. This Apex trigger example fires when a platform event message is published and creates a Chatter post on the admin profile with event details.

trigger RealtimeAlertEventTrigger on RealtimeAlertEvent (after insert) {
   Id profileId = [select Id from User where User.Profile.Name = 'System Administrator' limit 1].Id;
    for(RealtimeAlertEvent e : trigger.new) {        
       Feeditem Post = New Feeditem();
       Post.ParentId= profileId;
       Post.Body = 'Alert occurred in the service: ' + e.Source + '\n' +
            'Name: ' + e.Description + '\n' +
            'Severity: ' + e.EventDateTime + '\n' +
            'Payload: ' + e.Payload + '\n' +
            'EventDate: ' + e.EventDateTime + '\n' +
            'Description: ' + e.Name + '\n';
       insert Post;
    }
}

Example

The code example displays as a Chatter post that contains the following:

Alert occurred in the service: aws cloudwatch alarm
Name: alert description
Severity: 2021-11-05 11:11:11
Payload: payload
EventDate: 2021-11-05 11:11:11
Description: alert name