Luke Wyman
07/21/2021, 5:53 PMServiceBusStack
should work just fine:
import * as cdk from '@aws-cdk/core';
import * as sst from '@serverless-stack/resources';
export class ServiceBusStack extends sst.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const performancesQueue = new sst.Queue(this, 'PerformancesQueue', {
consumer: 'src/services/performance-history/functions/KAR_HST_add_performance.handler',
});
}
}
Then, in the RotationsStack
, I'll just reference the queue to give Rotations permissions so that it can add the messages.
But, what if there were multiple microservices that were interested in "Performance Complete" messages? It seems I'd want a consumers
property on sst.Queue
, not just consumer
. Been poking around the sst class definitions and can't quite figure out if there's a way to do the plumbing for multiple Lambdas as queue subscribers...thdxr
07/21/2021, 5:59 PMthdxr
07/21/2021, 6:00 PMFrank
Frank
Frank
Luke Wyman
07/21/2021, 7:00 PMFrank