Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make boto3 (and botocore) dependency implicit #957

Closed
villekr opened this issue Jan 14, 2022 · 3 comments
Closed

Make boto3 (and botocore) dependency implicit #957

villekr opened this issue Jan 14, 2022 · 3 comments

Comments

@villekr
Copy link

villekr commented Jan 14, 2022

aws-lambda-powertools naturally depends on boto3 (and thus botocore) and dependency is defined in pyproject.toml. However this explicit dependency means that when building lambda layer package out of my own project I'll end up having boto3 and botocore in layer zip package. If I have only aws-lambda-powertools as a dependency then lambda layer zip will end up roughly 11.9MB. If I remove boto3 and botocore before zipping I'll end up to 2.8MB. As Lambda has 50MB layer zip limit then 11.9MB is too much from one dependency. Considering also the fact that you'll anyway already have boto3 preinstalled when using Python runtimes it's unnessessary to include in layer zip.

Of course I can workaround this by removing boto3 and botocore before zipping the layer package. Or I could try to separate dependencies to multiple layers but this will complicate deployments.

What were you trying to accomplish?

Expected Behavior

Current Behavior

Possible Solution

Move boto3 to as a dev-dependency and instruct developers using custom build docker runtime to include boto3 and a dependency.

Steps to Reproduce (for bugs)

Environment

  • Powertools version used: 1.24.0
  • Packaging format (Layers, PyPi): Layers, Pypi
  • AWS Lambda function runtime:: Python 3.9
  • Debugging logs

How to enable debug mode**

# paste logs here
@villekr villekr added bug Something isn't working triage Pending triage from maintainers labels Jan 14, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 14, 2022

Thanks for opening your first issue here! We'll come back to you as soon as we can.

@heitorlessa
Copy link
Contributor

Hi @villekr - thank you for opening an issue with us, this is being explored in the roadmap and it has more details on why it's not that simple (e.g., X-Ray SDK depends on it, and SDKs are updated every quarter, 6 months or on a yearly basis): aws-powertools/powertools-lambda#61

We're close to a solution, and v2 will be a modularized Powertools with AWS SDK being an optional dependency.

@heitorlessa heitorlessa removed bug Something isn't working triage Pending triage from maintainers labels Jan 14, 2022
@villekr
Copy link
Author

villekr commented Jan 14, 2022

Thanks for the reply. Didn't know to look for an existing item in backlog. But excellent to hear that modularized v2 is coming!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants