terraform-aws-modules / terraform-aws-lambda

Terraform module, which takes care of a lot of AWS Lambda/serverless tasks (build dependencies, packages, updates, deployments) in countless combinations 🇺🇦

Home Page:https://registry.terraform.io/modules/terraform-aws-modules/lambda/aws

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Poetry support for groups dependencies

marrataj opened this issue · comments

Is your request related to a problem? Please describe.

For managing dependencies of our lambdas we're using poetry, however it makes it frustraiting that in order to build dependencies for different lambdas in one project you either need to specify separate pyproject.toml file for each lambda, even though they might share same packages, or do some tricks with commands in source_path that will install and zip dependecies for specific lambda, specially when in one pyproject.toml you can specify common packages and create separate groups of packages for specific lambda, then, it's enough to either call:
poetry install --with=<group_name> -- this will install common and specific lambda packages
or
poetry export --with=<group_name> --directory=<pyproject dir> > requirements.txt -- this will export common and lambda specific dependencies to requirements.txt

Describe the solution you'd like.

It would be nice to have groups parameter passed to poetry command, which would then include groups dependencies, and avoid a need of having multiple pyproject.toml files in one project, which would make it easier to maintain.
Also then, whenever new dependency needs to be added it's then enough to do it from root path of the project.

Tricky part with this solution might be that lambda deployment shouldn't be dependent on changes in pyproject.toml, as adding dependency to one lambda would cause rebuild of all lambdas.

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

This issue was automatically closed because of stale in 10 days

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

This issue has been resolved in version 7.6.0 🎉