Beispiel #1
0
def deploy_lambda_fn(fn_name, run_time, handler, role_arn, src_folder):
    folder_path = path.join(path.dirname(path.abspath(__file__)), src_folder)
    zip_file = Utils.make_zip_filebytes(path=folder_path)
    return lambda_client().create_function(FunctionName=fn_name,
                                           Runtime=run_time,
                                           Role=role_arn,
                                           Handler=handler,
                                           Code={'ZipFile': zip_file},
                                           Timeout=LAMBDA_TIMEOUT,
                                           MemorySize=LAMBDA_MEM,
                                           Publish=False)
Beispiel #2
0
def update_lambda_code(func_name, src_folder):
    folder_path = path.join(path.dirname(path.abspath(__file__)), src_folder)
    zip_file = Utils.make_zip_filebytes(path=folder_path)
    return lambda_client().update_function_code(FunctionName=func_name,
                                                ZipFile=zip_file)