Skip to content

Instantly share code, notes, and snippets.

@kapilt
Last active June 6, 2018 06:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kapilt/770bdf5d2a55b7385a9c to your computer and use it in GitHub Desktop.
Save kapilt/770bdf5d2a55b7385a9c to your computer and use it in GitHub Desktop.
Log output
The area below shows the logging calls in your code. These correspond to a single row within the CloudWatch log group corresponding to this Lambda function. Click here to view the CloudWatch log group.
START RequestId: 2644abca-b08d-11e5-a8cb-e1cccca020f0 Version: $LATEST
Unable to import module 'lambda_function': No module named lambda_function
END RequestId: 2644abca-b08d-11e5-a8cb-e1cccca020f0
REPORT RequestId: 2644abca-b08d-11e5-a8cb-e1cccca020f0 Duration: 72.41 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 8 MB
from __future__ import print_function
print("Loading Function")
def lambda_handler(event, context):
print("Got Here")
return 1
$ md5 lambda-2.zip
md5 lambda-2.zip
MD5 (lambda-2.zip) = f4da7d8e551e9214dc27ed9673d43ad4
$ unzip -lv lambda-2.zip
unzip -lv lambda-2.zip
Archive: lambda-2.zip
Length Method Size Ratio Date Time CRC-32 Name
-------- ------ ------- ----- ---- ---- ------ ----
138 Defl:N 112 19% 01-01-16 08:38 0a224fa9 lambda_function.py
-------- ------- --- -------
138 112 19% 1 file
zip -j lambda-2.zip f/lambda_function.py
aws lambda create-function \
--region us-east-1 \
--runtime python2.7 \
--role "arn:aws:iam::11221122111:role/lambda_basic_execution" \
--description "testing venv problems" \
--timeout 10 \
--memory-size 128 \
--handler lambda_function.lambda_handler \
--zip-file fileb://lambda-2.zip \
--function-name maid-dev-test-2
@krchandanvk
Copy link

error- Unable to import module 'lambda': No module named 'urllib2'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment