Verify that events sent from Salesforce are received in EventBridge using a CloudWatch log.
- Click the rule that you just created.
- Under Targets, click the log. The CloudWatch log opens in a new tab.
-
Publish an event from Salesforce. In this example, we publish an event message with REST
API.
-
Perform a POST request to this URI. If using Postman, click REST > SObject >
SObject Create, and replace the
:SOBJECT_API_NAMEplaceholder withCarbon_Comparison__e./services/data/v58.0/sobjects/Carbon_Comparison__e/Use this request body.
{ "Annual_Mileage__c" : "12003", "Current_Vehicle__c" : "Fast Car", "Model_Year__c" : "2021" }To find out about methods for publishing an event, see Publishing Platform Events in the Platform Events Developer Guide. For example, you can use REST API to publish thisCarbon_Comparison__eevent message.
-
Perform a POST request to this URI. If using Postman, click REST > SObject >
SObject Create, and replace the
-
You get a response similar to this response. The status of
OPERATION_ENQUEUEDmeans that the platform event message is published asynchronously.{ "id": "e00xx0000000001AAA", "success": true, "errors": [ { "statusCode": "OPERATION_ENQUEUED", "message": "e4aa03c9-d0e0-4c80-bf93-2e6779096018", "fields": [] } ] } -
Refresh the CloudWatch log stream. The received event is displayed in the log group,
similar to this event.
{ "version": "0", "id": "6f33d717-8e35-4488-5690-89e681b5737c", "detail-type": "Carbon_Comparison__e", "source": "aws.partner/salesforce.com/00DRM000000LqxV2AS/0YLRM00000001es4AA", "account": "XXXXXXXXXXXX", "time": "2023-04-03T19:23:23Z", "region": "us-west-2", "resources": [], "detail": { "payload": { "CreatedById": "005RM000002eap4YAA", "Current_Vehicle__c": "Fast Car", "CreatedDate": "2023-04-03T19:23:22.686Z", "Model_Year__c": "2021", "Annual_Mileage__c": 12003 }, "schemaId": "mVBhpA7tU9MCtBEbqjycBQ", "id": "118dab75-7b45-498e-8478-52d0324c1060" } }The received event contains the payload of the Salesforce event in thedetailfield. The top-level fields, such asversionanddetail-type, are EventBridge event fields. Thedetail-typefield contains the Salesforce event API name. In combination with thesourcefield, thedetail-typefield identifies the fields and values that appear in thedetailfield. For more information, see Amazon EventBridge events in the AWS documentation.