You are here:
Create an EventBridge Rule for Logging Events in a CloudWatch Log
To test the connection between Salesforce and AWS and ensure that the event messages are received in EventBridge, add a CloudWatch log as a target of a rule. Incoming event messages from Salesforce are logged in CloudWatch.
For more information, see Amazon EventBridge rules and Amazon EventBridge targets in the AWS documentation.
- In Amazon Eventbridge, click Rules.
-
Select your event bus from the dropdown. The name of the event bus is the same as the name
of the partner event source that you queried earlier. It’s in this format:
aws.partner/salesforce.com/orgID/channelID - In the Rules section, click Create rule.
- Provide a name for your rule.
- Click Next.
- Under Event source, select AWS events or EventBridge partner events.
-
Skip the Sample event section. In Event pattern, for Event source, select
EventBridge partners.
- From the partner dropdown, select Salesforce.
-
For Event type, select All Events. The event pattern box
autopopulates to this value.
{ "source": [{ "prefix": "aws.partner/salesforce.com" }] }
-
The rule matches incoming events based on the defined pattern. If you want to add a filter
to match a specific platform event, match events whose
detail-typefield contains the API name of the platform event, for example,Carbon_Comparison__e. For more information about event pattern matching, see Content filtering in Amazon EventBridge event patterns in the AWS documentation.- Under Event pattern, click Custom patterns (JSON editor).
-
In the input box, In Define pattern, select Custom pattern, and
replace the pattern with this pattern.
{ "source": [{ "prefix": "aws.partner/salesforce.com" }], "detail-type": ["Carbon_Comparison__e"] }
- Click Next.
- Under Target 1, Target types, select AWS service.
- Under Select a target, select CloudWatch log group.
-
Complete the log group path. For example:
/aws/events/mygroup/log. - Click Next and then Next.
- Review the rule that you created, and then click Create rule.
After creating the rule and the Cloudwatch log, verify receiving events in Verify Receiving Events in CloudWatch.

