Skip to content

lambda: email notification through sns and lambda

Vaquar Khan edited this page Jan 13, 2022 · 1 revision

https://stackoverflow.com/questions/52194888/email-notification-through-sns-and-lambda

import time import boto3 import json

def lambda_handler(event, context): #client = boto3.client('athena')

id=event['id'] account=event['id'] region=event['region'] resources=event['resources'] name=event['detail']['name'] status=event['detail']['status'] startDate=event['detail']['startDate'] stopDate=event['detail']['stopDate'] input=event['detail']['input']

print("id="+str(id)) print("account="+str(account)) print("name="+str(name))

json_object = json.loads(input) json_formatted_str = json.dumps(json_object, indent=2) print("json_formatted_str"+json_formatted_str)

return { 'statusCode': 200, 'body': json.dumps('Transform event bridge json Lambda!') }

Clone this wiki locally