Dan Van Brunt
10/24/2021, 11:52 AMEventBus
I’ve created for aws:mediaconvert
only triggers manually when testing but when I mediaconvert.createJob
it successfully completes but the eventBus function doesn’t trigger. Are they any special permissions I need to add to allow mediaconvert to create that event?
new sst.EventBus(this, 'TranscoderBus', {
rules: {
rule1: {
eventPattern: {
source: ['aws.mediaconvert'],
detailType: ['MediaConvert Job State Change'],
detail: {
status: ['COMPLETE'],
},
},
targets: ['lib/constructs/VideoTranscoder/lambdas/jobstatus.handler'],
},
},
})
I’ve also tried lowering the eventPattern to just the sourceDan Van Brunt
10/24/2021, 12:50 PMaws:codebuild
However, after much playing around and a support ticket to AWS, I found out that aws service events only trigger on the default bus and not custom buses. Only way to get them on the custom bus is to setup a rule on the default and target the custom bus.
So I guess what I really wanted here was just a cdk core Rule
😞Dan Van Brunt
10/24/2021, 1:10 PMEventRule
and it allowed you to create a custom bus OR by default use the default bus. Otherwise, for default bus things… I would use this syntax…
const jobstatusFunction = new sst.Function(this, 'JobStatusFunction', {
handler: 'lib/constructs/VideoTranscoder/lambdas/jobstatus.handler',
})
new eb.Rule(this, 'TranscoderEventRule', {
eventPattern: {
source: ['aws.mediaconvert'],
detailType: ['MediaConvert Job State Change'],
detail: {
status: ['COMPLETE'],
},
},
targets: [new ebt.LambdaFunction(jobstatusFunction)],
})
Ashishkumar Pandey
10/24/2021, 2:38 PMthdxr
10/24/2021, 4:18 PMDan Van Brunt
10/24/2021, 4:20 PMFrank
Frank
Joe Kendal
10/26/2021, 2:02 PM