-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Describe the feature you'd like
Let users construct a LambdaModel by passing a Zip files that packages Lambda code and dependencies.
How would this feature be used? Please describe.
You can package Lambda code and its dependencies in a couple of ways:
- Container images
- Zip files
We already support container images. A natural follow-up is to also support Zip files.
One implementation would be to change constructor signature to def __init__(self, package: str, role: str, client : Optional[botocore.client.BaseClient] = None), where the package argument could be any of the following:
- An S3 URL pointing to a Zip file
- A image URI pointing to a container image
- A path pointing to a Zip file
This would be a breaking change (the image_uri parameter is changed to package), so this feature should probably be implemented for the next major release.
Describe alternatives you've considered
To make the change non-breaking, we could add a zip_file parameter to the end of the parameter list and convert the image_uri and role parameters to keyword parameters: def __init__(self, image_uri = None, role = None, client = None, zip_file = None, client = None). This may be confusing to users.
Another implementation (that is breaking) would be to add a zip_file in the middle of the parameter list: def __init__(self, role, image_uri = None, zip_file = None, client = None). This implementation may also be confusing to users.
Additional context
Here's some relevant documentation about deploying Lambda functions packaged as .zip archives: https://docs.aws.amazon.com/lambda/latest/dg/python-package.html.