-
I've updated a lambda function to use .NET8 runtime (instead of a custom container) to take advantage of the new SnapStart feature. My function is invoked via ApiGateway. The function works perfectly fine with all these changes and SnapStart disabled. However, when I enable SnapStart the invocation always fails with the following:
So essentially its running my custom code in RegisterBeforeSnapshot and then fails immediately after. Im interested to know if anyone can suggest a path to approach solving this issue? if indeed it is something Im doing incorrectly... |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
We'll look into this and may request more info. |
Beta Was this translation helpful? Give feedback.
Ok so I've resolved the issue, the LAMBDA_RUNTIMESUPPORT_DEBUG was very helpful so I appreciate you pointing that out to me.
My issue arose because I was using a Executable Assembly style but my cdk handler was configured for Class Library approach. Interestingly that still worked with snapstart disabled and thats what caused the confusion. When SnapStart was enabled, it would take over and it would search for a constructor that wasnt there in the LambdaEntryPoint, and thus wouldnt register the hooks and wouldnt run any of my code.
TLDR I made some other changes, but the main fix for me was to update my handler to the execution assembly style: