Effect CommunityEC
Effect Community9mo ago
7 replies
Dave Meehan

What is the correct way to handle Lambda initialisation failure?

What is the correct way to handle Lambda initialisation failure?

For example, a typical pattern might be that the AWS resource (dynamo table etc) is passed into the lambda via the environment, and we might use Effect Config to extract and validate that. Given that the environment does not change during Lambda lifecycle, the Config requests can be made during service/layer construction, which occurs during the INIT_START phase (cold start).

What I'm seeing at the moment is that an unhandled promise rejection occurs during INIT_START, and it waits for the Lambda timeout before reporting that to the caller.

I'm using @effect-aws/lambda to create the handler.
Was this page helpful?