The script will create a ZIP file according to the AWS Documented process.
The resulting ZIP file can then be uploaded to S3 from where you can create the Lambda function, either by the AWS CLI, the AWS Console or by AWS CloudFormation. Just supply the S3 ZIP file URL and your Lambda function will be created.
- Create a directory for your Python script (Lambda function) and create the initial script. If you need additional packages, specify then in a
requirements.txt
file in the same directory as the Python script - Code... coffee... code... coffee... etc. (repeat as required)
- When you are done and need a ZIP file, run the packaging script. Each time you run it, a new package directory and ZIP file will be created.
Usually, boto3 will already be included in the Python Lambda environment, so no need to specify it in the requirements.txt
file.