- Newest
- Most votes
- Most comments
Hello.
AWS ChatBot can only accept specific event schemas, so if you use the EventBridge input transformer, you must format it as JSON as described in the following document.
https://docs.aws.amazon.com/chatbot/latest/adminguide/custom-notifs.html
{
"version": String,
"source": String,
"id": String,
"content": {
"textType": String,
"title": String,
"description": String,
"nextSteps": [ String, String, ... ],
"keywords": [ String, String, ... ]
},
"metadata": {
"threadId": String,
"summary": String,
"eventType": String,
"relatedResources": [ String, String, ... ],
"additionalContext" : {
"customerProvidedKey1": String,
"customerProvidedKey2": String
...
},
"enableCustomActions": true,
}
}
For example, if you create an Alarm from metrics for an EC2 instance, you can include the EC2 ID and account ID by using the following template in the EventBridge input transformer:
https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-transform-target-input.html
input path
{
"description": "$.detail.configuration.description",
"instance": "$.detail.configuration.metrics[0].metricStat.metric.dimensions.InstanceId"
}
input template
{
"version": "1.0",
"source": "custom",
"content": {
"textType": "client-markdown",
"title": ":warning:Alarm",
"description": "<description>",
"nextSteps": [
"AWS Account ID: 123456789012",
"EC2 ID: <instance>"
]
}
}
You can customize notifications delivered to your Microsoft Teams and Slack channels through AWS Chatbot by using custom notifications. This approach allows you to include additional contextual information about your AWS applications, such as application-specific details, team member tags, and remediation steps.
To implement this solution:
- Create a custom notification event in a specific schema format and send it to an SNS topic.
- You can generate these custom events using either:
- A Lambda function (if you need more complex processing)
- Amazon EventBridge Input Transformer (a simpler approach that doesn't require writing code)
- Configure the SNS topic to be associated with your AWS Chatbot configuration.
- AWS Chatbot will monitor this SNS topic and deliver your enriched custom notifications to your configured Microsoft Teams or Slack channels.
For your specific use case of adding AWS account names to CloudWatch alerts, the EventBridge Input Transformer approach would be less "clumsy" than writing a full Lambda function. You could use the transformer to add the account name based on the account ID in the original alert, then send the enriched message to the SNS topic that AWS Chatbot is monitoring.
This method allows you to enrich your notifications with relevant information like account names (distinguishing between Production, Development, etc.) without having to build and maintain a separate Lambda function.
Sources
Ten features for efficiently managing your AWS applications from Microsoft Teams and Slack using AWS Chatbot | AWS Cloud Operations Blog
answered 10 months ago
The Input Transformer sounds like a great idea and just what I wanted. Is there more information about how to add extra data to an event? For example, how would I add some keywords to a CloudWatch alarm?
Relevant content
asked 3 years ago
asked 2 years ago
- AWS OFFICIALUpdated 5 months ago

Agreed! However, I was hoping that I would be able to enrich the existing CloudWatch alert message to include features that the Chatbot would pick up on. I wonder if it would be possible to massage the existing CloudWatch message; for example, change the Subject line to be more fitting. :thinking:
If you want to add more data to JSON, I think you can do so by using EventBridge pipes or something similar. However, even in this case, Lambda, StepFunctions, etc. will be required. It would be difficult to change the default message. If it were completely customizable, you would need to use an API destination in EventBridge pipes to send messages without using the AWS Chat bot. https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes.html