Skip to content

Instantly share code, notes, and snippets.

@infoankitp
Created January 6, 2019 07:04
Show Gist options
  • Save infoankitp/2e258545c0d81a3822bc3f91910d9a04 to your computer and use it in GitHub Desktop.
Save infoankitp/2e258545c0d81a3822bc3f91910d9a04 to your computer and use it in GitHub Desktop.
import json
def lambda_handler(event, context):
print( "Event : " , event)
#This will print the event passed to lambda_handler in
#Cloudwatch Logs
print( "Context : " , context)
#This will print the context passed to lambda_handler in
#Cloudwatch #Logs
name = ""
if 'queryStringParameters' in event:
if event['queryStringParameters'] is not None:
if 'name' in event['queryStringParameters'] :
name = event['queryStringParameters']['name'] + " "
return {
'statusCode': 200,
'body': json.dumps('Hello {}from Lambda!'.format(name))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment