-
Notifications
You must be signed in to change notification settings - Fork 40
/
lambda.py
executable file
·32 lines (29 loc) · 969 Bytes
/
lambda.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
# coding=utf-8
# [% VIM_TAGS %]
#
# Author: Hari Sekhon
# Date: [% DATE # 2020-12-14 23:43:05 +0000 (Mon, 14 Dec 2020) %]
#
# [% URL %]
#
# [% LICENSE %]
#
# [% MESSAGE %]
#
# [% LINKEDIN %]
#
# Receives a Lambda event, prints it to CloudWatch logs along with some environment and context information and returns None
import os
# https://docs.aws.amazon.com/lambda/latest/dg/python-handler.html
def lambda_handler(event, context):
print("event:", event)
print("env:", os.environ)
# https://docs.aws.amazon.com/lambda/latest/dg/python-context.html
#print("context:", dir(context))
print("Lambda function ARN:", context.invoked_function_arn)
print("CloudWatch log stream name:", context.log_stream_name)
print("CloudWatch log group name:", context.log_group_name)
print("Lambda Request ID:", context.aws_request_id)
print("Lambda function memory limits in MB:", context.memory_limit_in_mb)
return