-
Notifications
You must be signed in to change notification settings - Fork 6
Help on internal dependencies packaging #66
Description
Feature request
Our team recently started using lambdas and we have been using lambda packager plug-in to easily resolve external dependencies and package. It works agreat.
After creating few lambdas, we realized that we are repeating some utility methods in each lambda trying to establish a shared 'utils' folder to avoid duplication of some common methods
Provided below is the proposed project structure for python code related to lambda. The 'utils' folder has my commonly used methods by different lambdas.
This might be what other teams trying to stick to DRY principle might be doing. so guessing this structure is not unique to our project.
ProjRoot\src
├── MyFirstLambdaHandler
└── index.py
├── MySecondLambdaHandler
└── index.py
├── MyThirdLambdaHandler
└── index.py
└── utils
└── common.py
└── shared.py
Before establishing the 'utils' folder when the packaging is done, had set LAMBDA_CODE_DIR: src/MySecondLambdaHandler to get the handler and it works fine.
After 'utils' folder is created, is it possible to package just 'MySecondLambdaHandler' and 'utils' without packaging all folders under source for each lambda.
Looked at documentation pages below but still not sure how to achieve it. Hence making a feature request.
https://github.mmm.com/MMM/aws-bootcamp/blob/master/noble/lambda-packager.md
https://github.com/3mcloud/lambda-packager/blob/master/docs/guides/user/python_packager.rst
For external dependencies, we use requirements.txt and use the REQUIREMENTS_FILE environment variable
So viewing 'Utils' folder as internal dependency, can we have something env variable say LAMBDA_CODE_DEPENDENCIES_DIR so that we can package intended lambda folder and dependency folder?