Events Trigger Lambdas from other Stages

Hi fellow cloud inhabitants
one issue I am facing is around isolation of environments - using stages.
we start a mediaconvert job (success) and want to consume the cloudwatchEvent it produces.
but the events are consumed across stages, meaning that our dev stage consumes events from our staging stage.
to remedy this, i added the stage: - ${opt:stage} to our function trigger events.

cloudwatchEvent:
event:

source:
  - 'aws.mediaconvert'
detail-type:
  - 'MediaConvert Job State Change'
detail:
  stage:
    - ${opt:stage , 'dev'}
  status:
    - 'COMPLETE'
    - 'ERROR'

Since having included this parameter, the lambda has not been triggered at all.
If i omit this parameter, the lambda triggers on all stages simultaneously, independent of the eventsource stage.

1 Like

Hi, Did you find any solution to this problem?