You are here:
Create an EventBridge Rule and Connect it to the API Destination
The EventBridge rule routes events from the event bus to the API destination, which results in making a REST call to publish an event back to Salesforce.
Prerequisites:
Create an API destination in Create an API Destination and Connection in EventBridge.
For more information about EventBridge rules, see Creating Amazon EventBridge rules that react to events in the AWS documentation.
- In Amazon Eventbridge, click Rules.
- Select an event bus from the dropdown that is the source of the events that you want to send to Salesforce.
- In the Rules section, click Create rule.
- Provide a name for your rule.
- Click Next.
-
Under Event pattern, select Custom patterns (JSON editor), and enter a filter. If you
don’t want to be specific with the filter, use a filter that matches anything except events
whose source field is
"dontSend".{ "source": [{ "anything-but": ["dontSend"] }] }For more information about event pattern matching, see Content filtering in Amazon EventBridge event patterns in the AWS documentation.
- Click Next.
- In Select targets, under Target 1, select EventBridge API destination.
- From the dropdown, select the API destination that you just created.
- Expand Additional settings.
-
Select Part of the matched event, and provide the part of the event
message to pass to the API destination. This step prevents the top-level Amazon event fields
from being sent to Salesforce. Only the part containing the Salesforce event fields from the
detail section of the original event are sent.
-
If the event format is an EventBridge event, provide this value:
$.detail -
If the event originates from a Lambda function, provide a path in the Lambda function
result message. For example, to return a section from the function response, use
$.detail.responsePayload.{responseSection}.
-
If the event format is an EventBridge event, provide this value:
- Click Next and then Next.
- Review the rule, and then click Create rule.
