Skip to content

Instantly share code, notes, and snippets.

@orirawlings
Created January 31, 2017 19:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orirawlings/04f82ccdd05ecfe07f905af1dbb1c110 to your computer and use it in GitHub Desktop.
Save orirawlings/04f82ccdd05ecfe07f905af1dbb1c110 to your computer and use it in GitHub Desktop.
A simple AWS lambda script that demonstrates forking out to an arbitrary binary for processing
import json
import subprocess
def lambda_handler(event, context):
p = subprocess.Popen(["env"], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
print p.communicate(json.dumps(event))[0]
return p.returncode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment