How to deserial custom parameter along with S3Event and ILambdaContext #1577
-
I'm configuring that when a new file is uploaded to S3, it will create an event to trigger my lambda function. The problem is that I don't know how to pass my custom parameter into the function. The code will be like this public async Task FunctionHandler(S3Event KeyEvent, ILambdaContext context, FunctionInput input) The parameter FunctionInput is a class that contains such information as Id, username, and password. Usually, I can use Event Json to pass value to the parameter (if there is only 1 parameter). Now, when there are 3, I get this error on the Cloudwatch log
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
@ngqtrieu99 Good morning. Lambda function handler accepts only 2 arguments: type for event and Thanks, @github-actions proposed-answer |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
@ngqtrieu99 Good morning. Lambda function handler accepts only 2 arguments: type for event and
ILambdaContext
(refer Lambda function handler in C# for more details). The event type is a POCO class which is used to match the JSON payload sent by the event source. I'm not sure how you would pass custom parameter while the Lambda function is invoked since the invocation is managed by the triggering source.Thanks,
Ashish
@github-actions proposed-answer