Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- def download_code(event, context):
- """
- Download the runtime environment of a lambda to a given s3 bucket.
- """
- os.system("/bin/tar -zcvf /tmp/code.tar.gz /var/runtime/")
- with open("/tmp/code.tar.gz", "rb") as code:
- s3.upload_fileobj(code, event['bucket_name'], 'code.tar.gz')
Add Comment
Please, Sign In to add comment