https://pulumi.com logo
#aws
Title
# aws
n

nice-airport-15607

06/16/2020, 8:55 PM
having a huge problem trying to get an sns topic, and then set the topic & topic arn for creating a subscription, has anyone else dealt with SNS topics & subscriptions?
i’ve tried
Copy code
const sometopic = pulumi.output(aws.sns.getTopic({ name: 'sometopic-3ce3de0' }, { async: true }))

const topicArn = sometopic.apply(o => o.arn)
and also:
Copy code
const someTopic = aws.sns.Topic.get('sometopic', '3ce3de0')
const topicArn = someTopic.apply(stack => pulumi.output(stack.arn))
but its not giving me the results I’m expecting of
Copy code
export declare type ARN = string;
its showing me crap like
Copy code
topicArn OutputImpl {
      __pulumiOutput: true,
      isKnown: Promise { <pending> },
      isSecret: Promise { false },
      resources: [Function],
      allResources: [Function],
      promise: [Function],
      toString: [Function],
      toJSON: [Function] }
f

faint-table-42725

06/16/2020, 10:20 PM
I assume you’re trying to do something like this?
Copy code
const sometopic = pulumi.output(aws.sns.getTopic({ name: 'sometopic' });
const subscription = new aws.sns.TopicSubscription("subscription", {
    topic: sometopic.arn
    // ...
});
Anything you’re getting stuck on?
n

nice-airport-15607

06/16/2020, 10:54 PM
Yeah that looks like it. But this is for the subscription permissions portion. Might work the same.
2 Views