skip to Main Content

Complete newbie to AWS and having trouble with this problem. I want to trigger a Lambda function upon the initial spin-up of an AWS MediaLive Channel that adds the channel details to a DynamoDB table. I’m having trouble finding a way to set this trigger.

I have tried using CloudWatch logs as a trigger, but it looks like the logs might only be generated when the channel has started, not when the channel is created, although I could be reading something wrong. I wanted to create a new test channel to see if its creation would show up in the CloudWatch logs, but unfortunately we’ve hit the upper limit of channels we can create and I’m not allowed to delete any currently existing ones. Any help (and any general Lambda function writing tips) would be appreciated.

2

Answers


  1. I’m not sure I fully understand the question, but my assumption is you write the channels state to DynamoDB and you want to fire a Lambda function when a new channel is created.

    If that’s the case, you can simply use DynamoDB streams and a Lambda trigger, with an event filter based on the state in your item.

    Login or Signup to reply.
  2. The CreateChannel event will appear in CloudTrail and on the EventBus. An eventbus rule can watch for said events and trigger the Lambda in response.

    This example from the aws-samples github has lambda code which reacts to event bus events.
    https://github.com/aws-samples/aws-medialive-fallback-switcher-lambda

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search