Greg
02/21/2022, 7:44 AMqueue
-url from within a sqs consumer? I would like to add an other message to the queue when the lambda is finished - I would like to chain commands this way.
So I’m looking to achieve the following functionality . Unfortunately this doesn’t work since Property 'setDefaultFunctionProps' does not exist on type 'Queue'.
const queue = new sst.Queue(this, "Queue", {
consumer: {
function: "src/consumer.main",
consumerProps: {
batchSize: 1,
},
},
})
queue.setDefaultFunctionProps({
environment: { queueUrl: queue.sqsQueue.queueUrl },
})
Arpad
02/21/2022, 7:47 AMevent.Records
that you can use which AWS sends, you get the ARN of the queue in eventSourceARN
, https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.htmlArpad
02/21/2022, 7:48 AMGreg
02/21/2022, 7:56 AMArpad
02/21/2022, 8:13 AMnew Function(...)
and pass that function as consumerArpad
02/21/2022, 8:13 AMGreg
02/21/2022, 9:15 AMconst queue = new sst.Queue(this, "Queue", {})
queue.addConsumer(this, {
function: {
handler: "src/consumer.main",
environment: {
queueUrl: queue.sqsQueue.queueUrl,
},
permissions: [queue],
},
consumerProps: {
batchSize: 1,
},
})
Arpad
02/21/2022, 9:18 AMArpad
02/21/2022, 9:19 AM