Skip to content

Ensure Lambda Bundles are of expected size #1471

Description

@mrgrain

Description

The handlers for a number of Lambda Function are larger than they need to be. Smaller bundles mean a shorter cold start time. In the past some of these were also unintentionally bundling aws-cdk-lib which will cause the handler size to be very large (10mb to 50mb) and bundle potentially disruptive dependencies. This has already caused issues in the past but was never rolled out to any bundles other than the transliteration one from the original incident.

We need to make some effort to ensure bundle sizes are minimal and add checks to ensure they stay like this.

  • Only include aws-sdk v3 client packages that are actually needed
  • Always exclude aws-cdk-lib from bundling so that code fails fast if used
  • Add checks to the build system that ensure all bundles are within expected parameters, fail otherwise

Use Case

No response

Other information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions