- zips all files from the configuration in a file
- upload the zip file to S3 Bucket
- Update function code of the given Lambda function
- clean cloudwatch logs
The first run create a config file named lapd.yml
in the current directory.
For now only the "default" function is used.
functions:
- name: default
filter:
- base_path: .
relative_path: src
include:
- '*'
exclude: []
- base_path: .venv/lib/python3.11/site-packages/
relative_path: .
include:
- '*'
exclude: []
s3_bucket: lapd
package: deploy.zip
local_package_name: deploy.zip
Now you have to provide these informations
s3_bucket
S3 bucket name for the zip filepackage
S3 key for the zip filelocal_package_name
local zip file namefunctions
list of functions to deployfunctions.name
function namefunctions.include
list of files to include in the zip filefunctions.include.base_path
base path for the filesfunctions.include.relative_path
relative path for the filesfunctions.include.filter
list of files to include
lapd -function lambdafunctionname -purge
Output
2023/11/13 21:27:50 Adding files to zip
2023/11/13 21:27:50 Added: {. src [*] []}
2023/11/13 21:27:54 Added: {.venv/lib/python3.11/site-packages/ . [*] []}
2023/11/13 21:27:54 Upload
2023/11/13 21:28:05 Deploy code
2023/11/13 21:28:05 Deploying function lambdafunctionname
2023/11/13 21:28:07 Purge logs
You should exclude the package directory from the serverless package.
Example:
package:
individually: true
patterns:
- "!.venv/**"
- "!node_modules/**"
- "!tests/**"
- "!dist/**"