Skip to content

fix: remove unused aws-lambda package to eliminate aws-sdk v2 dependency#5088

Open
jensenbox wants to merge 1 commit intogithub-aws-runners:mainfrom
closient:fix/remove-unused-aws-lambda-dep
Open

fix: remove unused aws-lambda package to eliminate aws-sdk v2 dependency#5088
jensenbox wants to merge 1 commit intogithub-aws-runners:mainfrom
closient:fix/remove-unused-aws-lambda-dep

Conversation

@jensenbox
Copy link
Copy Markdown
Contributor

Summary

The aws-lambda npm package (npmjs.com/package/aws-lambda) is a CLI deploy tool last published in November 2021. It is listed as a production dependency in webhook and aws-powertools-util, but is not used anywhere at runtime.

Every import from 'aws-lambda' in the codebase (e.g. import { Context, SQSEvent } from 'aws-lambda') resolves to @types/aws-lambda — TypeScript type definitions that are erased at compile time. @types/aws-lambda is already correctly declared as a devDependency in all packages that use it.

Why this matters

The aws-lambda package transitively depends on aws-sdk@^2.814.0 (v2), which reached end-of-support on September 8, 2025. Advisory GHSA-j965-2qgj-vjmq flags all of aws-sdk v2 with no patch available — the only remediation is migrating to v3. This causes the Dependency vulnerability scan to fail on any PR that modifies the lockfile enough to trigger a dependency graph rebuild.

What this PR does

  • Removes aws-lambda from dependencies in lambdas/functions/webhook/package.json and lambdas/libs/aws-powertools-util/package.json
  • Regenerates yarn.lock, eliminating aws-sdk v2 and its transitive dependency tree from the lockfile

What this PR does NOT do

  • Does not change any source code — no runtime behavior changes
  • Does not remove @types/aws-lambda (the TypeScript types) — those remain as devDependencies

Test plan

  • All 352 tests pass (yarn test across all 7 projects)
  • Dependency vulnerability scan should now pass (no more aws-sdk v2 in the dependency graph)

The `aws-lambda` npm package (a CLI deploy tool, last updated 2021) was
listed as a production dependency in `webhook` and `aws-powertools-util`
but is not used anywhere at runtime. All imports from 'aws-lambda' in
the codebase resolve to `@types/aws-lambda` (TypeScript type
definitions), which is already correctly declared as a devDependency.

The `aws-lambda` package transitively pulls in `aws-sdk` v2 (EOL since
Sep 2025), which triggers the dependency vulnerability scan
(GHSA-j965-2qgj-vjmq). Since there is no patch for v2 — the advisory
recommends migrating to v3 — the correct fix is to remove the unused
package rather than suppressing the scanner.

This eliminates aws-sdk v2 and its unnecessary transitive dependencies
from the lockfile.
@jensenbox jensenbox requested a review from a team as a code owner March 31, 2026 06:20
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

Successfully merging this pull request may close these issues.

1 participant