Mitch Garnaat

Updating the S3 example and fixing a bug in the way directories are zipped for upload to Lambda.

......@@ -69,6 +69,7 @@ def main(config=None, debug=False, command=None):
if command == 'deploy':
click.echo('Deploying ...')
kappa.deploy()
click.echo('...done')
elif command == 'test':
click.echo('Sending test data ...')
kappa.test()
......
......@@ -91,7 +91,7 @@ class Kappa(object):
def _zip_lambda_dir(self, zipfile_name, lambda_dir):
LOG.debug('_zip_lambda_dir: lambda_dir=%s', lambda_dir)
LOG.debug('zipfile_name=%s', zipfile_name)
relroot = os.path.abspath(os.path.join(lambda_dir, os.pardir))
relroot = os.path.abspath(lambda_dir)
with zipfile.ZipFile(zipfile_name, 'w') as zf:
for root, dirs, files in os.walk(lambda_dir):
zf.write(root, os.path.relpath(root, relroot))
......
......@@ -10,13 +10,13 @@ lambda:
name: S3Sample
zipfile_name: S3Sample.zip
description: Testing S3 Lambda handler
path: examplefolder
path: examplefolder/
handler: CreateThumbnail.handler
runtime: nodejs
memory_size: 128
timeout: 3
mode: event
test_data: input.json
event_source: arn:aws:s3:::garnaat_pub
event_source: arn:aws:s3:::sourcebucket
s3_events:
- s3:ObjectCreated:*
\ No newline at end of file
......