'Read EventBridge event output JSON using Lambda python
I need some help with filtering some data from a EventBridge Notification. Currently, we have an EventBridge "RDS Cluster Event" Rule with Target = SNS. So, whenever an RDS Cluster even is encountered, we get email notification via SNS but there is too much info in the json email and we want to format it. Current email:
{
"version":"0",
"id":"xxxxx-xxx-xxx-x-x-x-x",
"detail-type":"RDS DB Cluster Event",
"source":"aws.rds",
"account":"0000000000000",
"time":"2030-04-29T99:99:18Z",
"region":"xx-xxx-xx",
"resources":["arnxxx:xxx:cluster:db-cluster"],
"detail":{
"EventCategories":["configuration change"],
"SourceType":"CLUSTER",
"SourceArn":"arnxxx:xxx:cluster:db-cluster",
"Date":"2030-04-29T99:99:18Z",
"Message":"This is a test",
"SourceIdentifier":"db-cluster",
"EventID":"RDS-EVENT-0000"
}
}
I want to filter out the content from this json in the email and get an email like:
EventCategories: configuration change
Date: 2030-04-29T99:99:18Z
Message: This is a test
SourceIdentifier: db-cluster
region: xx-xxx-xx
account: 0000000000000
Need help with parsing the eventbridge incoming json logs and change the output to above shown and then receive the formatted output in my email (using SNS).
Please suggest.
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
