https://pulumi.com logo
Title
e

elegant-pager-5412

04/22/2021, 2:46 PM
I have
queueA
and
queueB
, I want that when a message is processed from
queueA
to push a new message to
queueB
b

brave-planet-10645

04/22/2021, 2:50 PM
You won't use Pulumi for this. You'll need to use the AWS SDK within your lambda code to do this. AWS has a doc for this here: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/sqs-examples-send-receive-messages.html
e

elegant-pager-5412

04/22/2021, 2:53 PM
😮 Why not?
b

brave-planet-10645

04/22/2021, 3:05 PM
Because that's part of your application, not your infrastructure. I guess you could use lambda destinations to pass on a message saying that the lambda processing message on
queueA
has been successful, but it wouldn't have the content of the message that was on
queueA
e

elegant-pager-5412

04/22/2021, 3:10 PM
@brave-planet-10645 I see. What is the best way to do it? It seems very cumbersome to use the SDK for this
b

brave-planet-10645

04/22/2021, 3:13 PM
I guess it depends what information you need in the message on the second queue. If you're happy with "I want to know that the lambda was successful in processing the message" then a destination is probably ok but if you need some part of the message from
queueA
then you'll probably want to send it using the SDK What are you doing with the data that the lambda processes? Are you putting into a database, or handling it in some other way?
e

elegant-pager-5412

04/22/2021, 3:14 PM
I’m Fetching X records, saving them as a chunk in a DB and want to send a message to another SQS that will process the records
If I create
queueB
using Pulumi, how do I reference its ARN inside the lambda?
l

lemon-machine-35564

04/22/2021, 4:59 PM
Look into Event Source Mappings