Hi, in my code Pulumi is missing some dependencies...
# general
f
Hi, in my code Pulumi is missing some dependencies which makes the script fail I have this in one part of my code
Copy code
const retry_queue = new aws.sqs.Queue("retry", {
        delaySeconds: 180,
        messageRetentionSeconds: 345600, // 4 days
and then later
Copy code
});
const queueURL = retry_queue.name.apply(name => aws.sqs.getQueue({
        name: name,
    }).then(queue => queue.url));
however when I up this I get the error that the queue with the name is not available.
Copy code
error: Running program '/working/src/stack-staging' failed with an unhandled exception:
    Error: invocation of aws:sqs/getQueue:getQueue returned an error: invoking aws:sqs/getQueue:getQueue: 1 error occurred:
        * Error getting queue URL: AWS.SimpleQueueService.NonExistentQueue: The specified queue does not exist for this wsdl version.
If I hard code the queueURL and
pulumi up
and then restore the second snippet then the script works. Is there a way to ensure a dependency here?
c
As far as I can see there is no
url
property on
Queue
. Where are you getting
.url
from?
f
the
url
property is on
aws.sqs.getQueue
c
Ah. I was looking at
get()
not
getQueue()
.
I would look at the stack and see the value of
name
on the
retry
Queue
resource. Are you able to hardcode the value of
name
in
getQueue
with whatever that value is?
f
this isnt getting used downstream, only as an output so i am able to put a dummy value. when I do that and
pulumi up
then it runs, then replace the dummy value with the original code and
pulumi up
again then everything works. The issue as I see it is that it is trying to get the name of the queue in the preview, (before I confirm the stack update) and on first run this obviously isnt going to exist.