I am attempting to execute a program using an AWS Lambda function with layers and triggers in AWS GovCloud. However, I am facing a memory error during the process of uploading a ZIP file containing the Python environment with the necessary modules and imports.
Key Points:
Environment Setup: The Python environment file was created using Docker and then copied from the Docker image to my local machine.
File Size Issue: The resulting file size of the environment exceeds the accepted limit for Lambda layers.
Module Separation
Attempt: I tried to separate the required modules, but even with only OpenCV included, I still encountered memory issues.
AWS GovCloud Constraints: Operating within AWS GovCloud adds complexity, as many Python imports are not pre-included.
Challenge: Finding a solution to implement Lambda functions with complex programs and numerous dependencies in AWS GovCloud, given the constraints on file size and memory
Environment Creation:
Created the Python environment file using Docker.
Copied the environment from the Docker image to my local machine.
File Size Issue:
The resulting file size of the environment exceeded the accepted limit for Lambda layers.
Module Separation Attempt:
Attempted to separate the required modules to reduce the file size.
Created a ZIP file containing only the OpenCV module.
Despite this effort, I still encountered memory issues during the upload.
What I Expected:
Expectation:
Expected the ZIP file containing the Python environment and necessary modules to upload successfully to AWS Lambda layers without exceeding the size limit.
Function Execution:
Expected the Lambda function to execute the program correctly with all required dependencies in place.
Brian Perker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.