def zip(temp_package_path):
"""Create the StreamAlert Lambda deployment package archive.
Zips all dependency files to run the function,
and names this zipfile based on the current date/time,
along with the Lambda function module version.
example filename: stream_alert_1.0.0_20161010_00:11:22.zip
Only package in the `.py` files per AWS's instructions
for creation of lambda functions.
Args:
temp_package_path (str): the temporary file path to store the zip.
Returns:
str: Deployment package full path
"""
LOGGER_CLI.debug('Creating Lambda package: %s', temp_package_path + '.zip')
package_path = shutil.make_archive(temp_package_path, 'zip', temp_package_path)
LOGGER_CLI.info('Package successfully created')
return package_path
评论列表
文章目录