You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法针对指定MediaLive频道及StartChannel事件触发Lambda

解决方案:精准匹配MediaLive频道启停的EventBridge事件模式

MediaLive触发的EventBridge事件属于状态变更类事件,而非API调用事件,因此你之前尝试的detail-type: StartChannel或detail.eventName的匹配逻辑均不适用,正确的匹配方式需基于事件本身的结构:

1. 匹配频道启动事件的模式

针对频道流开启(管道启动)的场景,使用以下事件模式:

{
  "source": ["aws.medialive"],
  "detail-type": ["MediaLive Channel State Change"],
  "resources": ["arn:aws:medialive:us-west-2:111122223333:channel:1234567"],
  "detail": {
    "message": [{ "prefix": "Pipeline started" }]
  }
}

2. 匹配频道停止事件的模式

针对频道流停止(管道停止)的场景,使用以下事件模式:

{
  "source": ["aws.medialive"],
  "detail-type": ["MediaLive Channel State Change"],
  "resources": ["arn:aws:medialive:us-west-2:111122223333:channel:1234567"],
  "detail": {
    "message": [{ "prefix": "Pipeline stopped" }]
  }
}

关键说明

  • MediaLive状态变更事件的detail-type固定为MediaLive Channel State Change,这是匹配的核心标识,不能替换为API操作名称(如StartChannel)。
  • 使用prefix匹配message字段是为了兼容主备管道的场景(事件消息可能包含Pipeline 1 started或Pipeline 2 started),确保所有管道启动/停止的情况都能触发Lambda。
  • 若需更精准匹配单管道事件,可直接指定完整消息内容,例如"message": ["Pipeline 1 started for channel"]。

内容的提问来源于stack exchange,提问作者Naxxio

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.22 04:15:10