Skip to content

Instantly share code, notes, and snippets.

Last active June 18, 2016 00:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
#!/usr/bin/env python
from __future__ import print_function
import awscli
import awscli.clidriver
from cStringIO import StringIO
import sys
import json
def lambda_handler(event, context):
old_stdout = sys.stdout
sys.stdout = mystdout = StringIO()
driver = awscli.clidriver.create_clidriver()
sys.stdout = old_stdout
return json.loads(mystdout.getvalue())
if __name__ == '__main__':
event = {
"command": [
print(lambda_handler(event, None))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment