Sam Hulick
08/13/2021, 10:33 PMlambda.invokeFunction? seems like it’s a better idea to just import the function and call it directly. I can’t think of any reasons off the top of my head why this is a bad idea.. 🤔 or why it’s more advantageous to use lambda.invokeFunctionSam Hulick
08/13/2021, 10:34 PMInvocationType: 'Event' to run it asynchronously.thdxr
08/13/2021, 10:35 PMthdxr
08/13/2021, 10:36 PMSam Hulick
08/13/2021, 10:36 PMawait. or have Lambda A invoke Lambda B with InvocationType: 'Event'Sam Hulick
08/13/2021, 10:37 PMSam Hulick
08/13/2021, 10:37 PMSam Hulick
08/13/2021, 10:41 PMcase 'videos':
      await lambda.send(
        new InvokeCommand({
          InvocationType: 'Event',
          FunctionName: process.env.TRANSCODE_VIDEO_LAMBDA,
          Payload: Buffer.from(
            JSON.stringify({
              userId,
              id,
              fileId,
              bucket,
              key,
              duration,
            })
          ),
        })
      );
this is a good example. this is within my uploadProcessor Lambda which is executed directly from the front end after a file is uploaded to S3. the Lambda call here probably makes sense, because that video transcode process could take a couple minutes to analyze larger videos. I wouldn’t wanna tie up the front end waiting for thatFrank
Frank
thdxr
08/13/2021, 10:46 PMSam Hulick
08/13/2021, 10:46 PMthdxr
08/13/2021, 10:46 PMSam Hulick
08/13/2021, 10:47 PMSam Hulick
08/13/2021, 10:48 PMsst.EventBus is a thing