Guest User

Untitled

a guest
Apr 22nd, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import os
  2.  
  3. def download_code(event, context):
  4. """
  5. Download the runtime environment of a lambda to a given s3 bucket.
  6. """
  7. os.system("/bin/tar -zcvf /tmp/code.tar.gz /var/runtime/")
  8. with open("/tmp/code.tar.gz", "rb") as code:
  9. s3.upload_fileobj(code, event['bucket_name'], 'code.tar.gz')
Add Comment
Please, Sign In to add comment