Skip to content

Instantly share code, notes, and snippets.

@alchen99
Last active October 13, 2018 00:38
Show Gist options
  • Save alchen99/a6bbc05b5cdd182c3016fd6cca64a636 to your computer and use it in GitHub Desktop.
Save alchen99/a6bbc05b5cdd182c3016fd6cca64a636 to your computer and use it in GitHub Desktop.
Debugging AWS Lambda Python scripts
import json
logger.info('Event: %s' % json.dumps(event, indent=2))
See https://gist.github.com/gene1wood/24e431859c7590c8c834
time aws lambda invoke --invocation-type RequestResponse --function-name reportUntaggedInstances --region us-west-2 --log-type Tail --payload '{"region": "us-west-2"}' lambda.log
awslogs groups
awslogs get /aws/lambda/reportUntaggedInstances --no-group --no-stream -s '15 min ago'
aws ec2 describe-instances --filters "Name=instance-state-name,Values=running" | grep -i Name
More info http://engineering.pivotal.io/post/running-tests-in-aws-lambda/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment