From 132a8f692f7fb30a8fa5dd64f066b52586e3ec7e Mon Sep 17 00:00:00 2001 From: George Yoshida Date: Tue, 3 Nov 2015 17:28:54 +0900 Subject: [PATCH 1/2] Fixed issue with updating lambda configurations - When updating existing lambda functions, only code was updated. Changed to call `update-function-configuration` and update the configuration. --- lambda_uploader/uploader.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lambda_uploader/uploader.py b/lambda_uploader/uploader.py index 8aa2570..a434665 100644 --- a/lambda_uploader/uploader.py +++ b/lambda_uploader/uploader.py @@ -33,7 +33,6 @@ def upload_package(pkg, config): existing_function = False LOG.debug("function not found creating new function") - response = '' if existing_function: LOG.debug('running update_function_code') response = client.update_function_code( @@ -41,6 +40,17 @@ def upload_package(pkg, config): ZipFile=zip_file, Publish=config.publish, ) + LOG.debug("AWS update_function_code response: %s" % response) + LOG.debug('running update_function_configuration') + response = client.update_function_configuration( + FunctionName=config.name, + Handler=config.handler, + Role=config.role, + Description=config.description, + Timeout=config.timeout, + MemorySize=config.memory, + ) + LOG.debug("AWS update_function_configuration response: %s" % response) else: LOG.debug('running create_function_code') response = client.create_function( @@ -54,5 +64,5 @@ def upload_package(pkg, config): MemorySize=config.memory, Publish=config.publish, ) + LOG.debug("AWS create_function response: %s" % response) - LOG.debug("AWS create_function response: %s" % response) From 039a1e820fe5103a203cbdfba21c804c6683bfca Mon Sep 17 00:00:00 2001 From: George Yoshida Date: Tue, 3 Nov 2015 23:16:54 +0900 Subject: [PATCH 2/2] Fixed issue with updating lambda configurations - suppress pep8 warnings --- lambda_uploader/uploader.py | 1 - 1 file changed, 1 deletion(-) diff --git a/lambda_uploader/uploader.py b/lambda_uploader/uploader.py index a434665..97bbbba 100644 --- a/lambda_uploader/uploader.py +++ b/lambda_uploader/uploader.py @@ -65,4 +65,3 @@ def upload_package(pkg, config): Publish=config.publish, ) LOG.debug("AWS create_function response: %s" % response) -