Skip to main content

Overview

CloudWatch publishes alarm transitions to an SNS topic. A Lambda subscribed to that topic converts the notification into aciona.me’s canonical format and posts it to the alert source.

Prerequisites

  • AWS permission to create SNS topics, Lambda functions and modify alarms.
  • A service created in aciona.me and linked to a team with an active schedule.

1. Create the alert source in aciona.me

Under Alert sources, create a source of type CloudWatch. Copy the URL and the token.

2. Create the SNS topic

3. Deploy the transform Lambda

Runtime Node.js 20+, handler index.handler, no external dependencies. Environment variables: IAM role: AWSLambdaBasicExecutionRole.
In production, keep the token in SSM Parameter Store (SecureString) or Secrets Manager and read it on cold start — do not leave the value in plain text in the Lambda configuration.
index.mjs

4. Subscribe the Lambda to the topic

Harden the topic policy with aws:SourceAccount and, where possible, aws:SourceArn, so only CloudWatch in your account can publish.

5. Configure the alarm with AlarmActions and OKActions

OKActions is required for auto-resolution. Without it, CloudWatch never emits the OK transition and the incident stays open indefinitely. This is the most-forgotten step in the whole integration.

6. Test

Confirm the incident in the dashboard. Then force the recovery:
The incident should be resolved automatically.

How fields are translated

CloudWatch has no native severity. The Lambda resolves an alias in layers:
  1. A marker in AlarmDescription: [severity:critical]
  2. A keyword in the alarm name (critical, high, warning or info)
  3. Default: warning

Troubleshooting

The alarm has no OKActions pointing at the SNS topic. Add it with put-metric-alarm --ok-actions.
Check, in this order: the Lambda’s subscription to the topic is confirmed; the Lambda logs in CloudWatch Logs; ACIONA_INGRESS_URL and ACIONA_TOKEN are correct; the Lambda has internet egress (inside a VPC it needs a NAT).
Adjust the alarm dimensions, or create a service in aciona.me matching the name the Lambda derives. See the extractServiceHint function in the code.
Add [severity:critical] to the AlarmDescription or include the keyword in the alarm name.