Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
feat(lambda-params): add lambda params on invoke (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimrod Shlagman authored Sep 13, 2021
1 parent 84da158 commit c3f1ef1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/events/aws_sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -983,13 +983,16 @@ function AWSSDKWrapper(wrappedFunction) {
request.service.constructor.prototype
);

const resourceName = request.params ? request.params.FunctionName : 'lambda';
const requestPayload = request.params ? request.params.Payload : '';

if (!(serviceIdentifier in specificEventCreators)) {
// resource is not supported yet
return wrappedFunction.apply(this, [callback]);
}

const resource = new serverlessEvent.Resource([
'',
resourceName,
serviceIdentifier,
`${request.operation}`,
]);
Expand All @@ -1005,6 +1008,7 @@ function AWSSDKWrapper(wrappedFunction) {
]);

awsEvent.setResource(resource);
eventInterface.addToMetadata(awsEvent, { payload: requestPayload });

if ('patchInput' in specificEventCreators[serviceIdentifier]) {
specificEventCreators[serviceIdentifier].patchInput(this, awsEvent);
Expand Down

0 comments on commit c3f1ef1

Please sign in to comment.