Skip to content

Make boto3 (and botocore) dependency implicit #957

@villekr

Description

@villekr

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions