Prerequisites
You need permission to add webhooks in Corelayer and deploy AWS resources in the account and Region containing your alarms. The template creates EventBridge resources, an SQS queue, and a named IAM role. The template connects to a public HTTPS endpoint. For a private Corelayer deployment, configure private API connectivity in EventBridge before sending events.Setup
1. Create a source
In Corelayer, open Webhooks and click Add Webhook. Set Webhook type to CloudWatch alarms, enter a Source name, and click Create Webhook. Copy the Webhook URL, Webhook token, and CloudFormation snippet. The token is shown once, so store it before clicking Done.2. Deploy the EventBridge resources
Save the template below ascorelayer-cloudwatch.yaml. Replace <YOUR_WEBHOOK_URL> and <YOUR_WEBHOOK_TOKEN> with the values from Corelayer. If you copied the snippet from Corelayer, the URL is already filled in; you still need to replace the token placeholder.
Deploy the stack in the same account and Region as the alarms. Acknowledge the named IAM resources when creating the stack, or use CAPABILITY_NAMED_IAM with the CloudFormation CLI. AWS documents the required IAM acknowledgement.
The default rule forwards all alarm state changes in that Region. To select specific alarms, add a detail.alarmName filter to EventPattern before deploying. For another copy of the stack, change the explicit resource names, including the IAM role name, to avoid collisions.
Authorization: Bearer <YOUR_WEBHOOK_TOKEN>. The rule forwards the full event without an input transformer. Its role permits events:InvokeApiDestination on this destination, and the queue policy permits this rule to send failed deliveries to the dead-letter queue.
Creating the first API destination connection may also require permission to create the EventBridge service-linked role. EventBridge uses that role to manage the connection secret in Secrets Manager. See API destination permissions.
3. Check an alarm transition
When an alarm next changes toALARM, check the EventBridge rule’s monitoring metrics and look for the resulting investigation in Corelayer. A successful API call confirms delivery, not completion of the investigation.
If delivery fails, inspect the dead-letter queue and its message error attributes. The template allows up to five retries within one hour and retains queued failures for 14 days. AWS explains dead-letter queue errors and permissions.
How alerts are handled
ALARM starts an investigation. OK records a resolution without closing the Corelayer issue. Other states, including INSUFFICIENT_DATA, are recorded without investigation.
Keep the complete CloudWatch alarm event. Corelayer reads the alarm name, state, reason, and available metric details from its detail object.
See Manage sources to change or remove this source.
Troubleshooting
- The rule does not match: Check its AWS account, Region, event pattern, and whether the alarm changed state after the rule was created.
- Authentication fails: Check the connection’s API key name is
Authorizationand its value containsBearerfollowed by the Corelayer token. - The target cannot be invoked: Check the destination URL and the rule role’s
events:InvokeApiDestinationpermission. For private endpoints, check the connection’s network configuration. - No investigation starts: Confirm the event has
detail.state.valueset toALARMand was delivered without an input transformer or SNS envelope.