Ensure Lambda Bundles are of expected size

Open
#1,471 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
aws, typescript

Research direction

The issue names no files, tests, or build entry points. Start by locating the Lambda bundling configuration and build checks; done means required AWS SDK v3 clients are included, aws-cdk-lib is excluded, and oversized bundles cause the build to fail.

Written by the indexing model from the issue text.

Description

feature-request p2
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

Dominant language
TypeScript
Stars
240
Forks
30
Avg merge
1d 5h
Merged PRs (30d)
14

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cdklabs/construct-hub

All issues in cdklabs/construct-hub

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.