
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
@effect-aws/lambda
Advanced tools
Clean way to write AWS Lambda handlers using Effect.
It provides a makeLambda function that takes an EffectHandler and returns a native promise Lambda handler function.
The implementation supports defining global runtime layer with graceful shutdown. So all finalizers defined by acquireRelease will be called on lambda downscaling.
npm install --save @effect-aws/lambda
Without dependencies:
import type { SNSEvent } from "aws-lambda"
import { Effect } from "effect"
import { EffectHandler, makeLambda } from "@effect-aws/lambda"
// Define your effect handler
const myEffectHandler: EffectHandler<SNSEvent, never> = (event, context) => {
// Your effect logic here
return Effect.succeed("Hello, World!")
}
// Create the Lambda handler
export const handler = makeLambda(myEffectHandler)
With dependencies:
import { EffectHandler, makeLambda } from "@effect-aws/lambda"
import * as Logger from "@effect-aws/powertools-logger"
import type { SNSEvent } from "aws-lambda"
import { Context, Effect, Layer } from "effect"
interface FooService {
bar: () => Effect.Effect<never, never, void>
}
const FooService = Context.Tag<FooService>()
const FooServiceLive = Layer.succeed(
FooService,
FooService.of({ bar: () => Logger.logInfo("Not implemented") })
)
// Define your effect handler with dependencies
const myEffectHandler: EffectHandler<SNSEvent, FooService> = (event, context) =>
Effect.gen(function* () {
yield* Logger.logInfo("Received event", { event, context })
const service = yield* FooService
return yield* service.bar()
})
// Create the global layer
const LambdaLive = Layer.provideMerge(
FooServiceLive,
Logger.DefaultPowerToolsLoggerLayer
)
// Create the Lambda handler
export const handler = makeLambda(myEffectHandler, LambdaLive)
FAQs
Effectful AWS Lambda handler
The npm package @effect-aws/lambda receives a total of 50,018 weekly downloads. As such, @effect-aws/lambda popularity was classified as popular.
We found that @effect-aws/lambda demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.