1
votes

I am trying to setup Video Streaming architecture using AWS S3, CloudWatch and MediaConvert. I am following this link enter link description here as reference to setup the architecture.

In short the steps are

  1. Upload video to S3 bucket
  2. On Success S3 should trigger Lambda function which coverts input video into different formats and save them in another S3 bucket and logs in CloudWatch
  3. In CloudWatch based on event pattern trigger another Lambda function with the video file information
  4. Lambda function will save this information in desired location.

I am stuck in step 3 where I am able to trigger Lambda function but I couldn't able to understand how to pass converted video filepath or filename to lambda function in the target section.

Here is the custom event pattern to recognise media convert success event

{
  "source": [
    "aws.mediaconvert"
  ],
  "detail-type": [
    "MediaConvert Job State Change"
  ],
  "detail": {
    "status": [
      "COMPLETE",
      "ERROR"
    ],
    "userMetadata": {
      "application": [
        "VOD"
      ]
    }
  }
}
1

1 Answers

-1
votes

You should be creating a cloudwatch event rule to handle this scenario. steps for your case-

  1. go to cloudwatch/Rules
  2. Event Pattern
  3. Events by service
  4. Select Service Name
  5. Select Event Type

This should trigger a cloudwatch event and you need to process that event to get required information.