diff --git a/lambda_uploader/uploader.py b/lambda_uploader/uploader.py index 6e61100..ba8335b 100644 --- a/lambda_uploader/uploader.py +++ b/lambda_uploader/uploader.py @@ -61,6 +61,11 @@ def upload_existing(self, pkg): ) LOG.debug("AWS update_function_code response: %s" % conf_update_resp) + + waiter = self._lambda_client.get_waiter('function_updated') + LOG.debug("Waiting for lambda function to be updated") + waiter.wait(FunctionName=self._config.name) + LOG.debug('running update_function_configuration') response = self._lambda_client.update_function_configuration( FunctionName=self._config.name, @@ -80,6 +85,11 @@ def upload_existing(self, pkg): version = response.get('Version') # Publish the version after upload and config update if needed if self._config.publish: + + waiter = self._lambda_client.get_waiter('function_updated') + LOG.debug("Waiting for lambda function to be updated") + waiter.wait(FunctionName=self._config.name) + resp = self._lambda_client.publish_version( FunctionName=self._config.name, )