You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a typical example of using Powertools Logger, then adding the Lambda context so that its added to the structure log entries sent to CloudWatch:
The existing asLambda implementation specifically expects the provided function have only one argument (the input) so that the signature can be used both for the exported handler (for the benefit of NodeJsFunction) and also as a call from within a state machine. If a second argument is added, it causes state machine calls to show a type error (missing argument), and when passed through the ts2asl compiler and error is thrown:
Error: Lambda declaration must be callable with 0 or 1 argument
With Lambda Powertools, clients for logging, metrics etc can be added by using middy middleware, which wraps the handler declaration. I've not tried it, but it looks like it would be incompatible with how ts2asl currently identifies lambda declarations.
The text was updated successfully, but these errors were encountered:
Here is a typical example of using Powertools Logger, then adding the Lambda context so that its added to the structure log entries sent to CloudWatch:
The existing
asLambda
implementation specifically expects the provided function have only one argument (the input) so that the signature can be used both for the exported handler (for the benefit of NodeJsFunction) and also as a call from within a state machine. If a second argument is added, it causes state machine calls to show a type error (missing argument), and when passed through the ts2asl compiler and error is thrown:The error:
With Lambda Powertools, clients for logging, metrics etc can be added by using
middy
middleware, which wraps the handler declaration. I've not tried it, but it looks like it would be incompatible with how ts2asl currently identifies lambda declarations.The text was updated successfully, but these errors were encountered: