01/05/2022, 7:05 PM
Hey ho! Im trying to set up a SQS queue using pulumi, but i cant figure out for the life of me how to push message into that that queue. for example:
Copy code
new aws.lambda.CallbackFunction(
    callback: async (ev, ctx) => {
      // i want to do something like this

// to trigger this
mySqsQueue.onEvent("myEvent", () => console.log("hello"))


01/05/2022, 9:10 PM
Pulumi doesn't (as a general rule) provide APIs for using the infrastructure it helps provision. You need to use the infrastructures' own APIs for that. As in your link, you use the AWS SDK client to use an SQS queue.
👍 1
That said, Pulumi does provide simple wrappers (as mixins) for some SDKs, including the AWS ones. So you can use
const sqsClient = new aws.sdk.SQS();
and then use that object to send messages.
Note that you won't be able to send messages from the Pulumi program itself, because at the time it runs, the queue won't have been created yet. You can use it in lambdas and other code that you know runs after the infrastructure has been provisioned.


01/05/2022, 11:04 PM
great, that makes a lot of sense! i will give this another try!