-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
24 lines (21 loc) · 806 Bytes
/
main.py
File metadata and controls
24 lines (21 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import json
import boto3
eventbridge = boto3.client("events")
with open("result.json") as file:
result = json.loads(file.read())
response = eventbridge.put_events(
Entries=[
{
'Source': 'josharmi.driftsummary',
'DetailType': 'v1',
'Detail': json.dumps({
"account_id": boto3.client('sts').get_caller_identity().get('Account'),
"total_resources": result["summary"]["total_resources"],
"total_changed": result["summary"]["total_changed"],
"total_unmanaged": result["summary"]["total_unmanaged"],
"total_missing": result["summary"]["total_missing"],
"total_managed": result["summary"]["total_resources"],
}),
},
],
)