AWS CloudWatch
CloudWatch Alarms can notify OpsFusion through Amazon EventBridge. Route alarm state changes to an EventBridge rule, target an API destination pointed at OpsFusion, and use an Input Transformer to reshape the event into OpsFusion’s alert format — no Lambda function required for basic field mapping.
See API Overview for authentication and finding your Account ID/Team ID.
Configure the Webhook in EventBridge
Section titled “Configure the Webhook in EventBridge”- In CloudWatch, confirm your alarm publishes state changes to EventBridge (this is on by default for most alarms — CloudWatch emits
aws.cloudwatchevents automatically). - In Amazon EventBridge, create a Connection and an API Destination pointing at
https://api.opsfusion.cloud/v1/account/YOUR_ACCOUNT_ID/push/alert, with anAuthorizationheader set to your OpsFusion API key. - Create an EventBridge Rule matching
aws.cloudwatchalarm state-change events, with the API destination as its target. - On the same rule, open “Configure input” → “Input Transformer” and define:
- An Input Path — JSONPath expressions pulling values out of the event, e.g.
{"alarmName": "$.detail.alarmName", "reason": "$.detail.state.reason"} - An Input Template — the JSON body sent to OpsFusion, using those variables as placeholders.
- An Input Path — JSONPath expressions pulling values out of the event, e.g.
- Repeat with a second rule matching only the
OKstate, if you want CloudWatch to auto-resolve alerts in OpsFusion (see below).
Payload Template
Section titled “Payload Template”Input Template for the rule matching ALARM state:
{ "teamId": YOUR_TEAM_ID, "title": "<alarmName>", "description": "<reason>", "severity": 1, "status": 1}Input Template for the rule matching OK state: identical, with "status": 3.
EventBridge’s Input Transformer only maps and substitutes values — there’s no arithmetic, string comparison, or conditional logic available, so <state> (which resolves to the literal string "ALARM" or "OK") can’t be converted into OpsFusion’s integer status inline. Hardcoding status per rule, matched on alarm state in the rule’s event pattern, is the reliable approach; the same applies to severity, which has no CloudWatch-native equivalent to map from at all.
Field Mapping
Section titled “Field Mapping”| OpsFusion field | CloudWatch source |
|---|---|
teamId | Hardcoded per rule (or per alarm, via a tag-based Input Path) |
title | $.detail.alarmName |
description | $.detail.state.reason |
severity | Hardcoded per rule (1-3, based on alarm importance) |
status | Hardcoded per rule (1 for the ALARM-matching rule, 3 for the OK-matching rule) |
labels | Optional — additional Input Path fields (e.g. $.detail.region) |
Troubleshooting
Section titled “Troubleshooting”- Nothing arrives at OpsFusion: confirm the alarm is actually configured to emit EventBridge events (not just SNS) and that the rule’s event pattern matches
aws.cloudwatch. - Alerts never resolve in OpsFusion: confirm you created the second rule matching
OKstate withstatus: 3— a single rule matching onlyALARMwill never send a resolution. - Input Transformer fails silently: JSONPath in the Input Path only supports simple field extraction — no string manipulation, math, or conditionals. If you need those, add a small Lambda between EventBridge and the API destination instead.
- 403 from OpsFusion: verify the API Destination’s Connection has the
Authorizationheader set to a valid, non-expired API key.
Support
Section titled “Support”For integration support:
- Email: support@opsfusion.cloud
- See Send Alerts for the full API reference