@here running into some issues when trying to refe...
# typescript
c
@here running into some issues when trying to reference an arn when creating an sns topic (typescript project):
Copy code
const topicSubscription = new aws.sns.TopicSubscription("topic", {
    topic: snsTopic,
    protocol: "lambda",
    endpoint: lambda.arn
})
This is throwing the following error when running `$ pulumi up`:
Copy code
error: Running program '/Users/michaelstott/sns' failed with an unhandled exception:
    TypeError: Cannot read property 'arn' of undefined
        at Object.<anonymous> (/Users/michaelstott/sns/sns.ts:10:25)
        at Module._compile (internal/modules/cjs/loader.js:955:30)
The lambda in question is defined in another file and would be provisioned normally if not for this error. It seems that Pulumi is attempting to create the topic before the lambda is created. Is there a workaround for this?
m
Any chance you could post a bit more code showing how you’re instantiating, exporting and importing the reference to
lambda
?.
c
It's part of a larger project, but I'll try to post a poc soon.