AWS SNS - How to get topic arn by topic name

Gowsikan picture Gowsikan · Apr 19, 2016 · Viewed 10.9k times · Source

In my application i need to send messages to the given topic name. The topic is already created by other person and in a config file they give only the topic Name. My work is to push the messages in the given topic Name. Is there any way to get topic ARN by topic NAME in java?

Answer

Bryn picture Bryn · Mar 30, 2017

As stated in this answer using createTopic(topicName) is more direct approach. In case topic have been created before, it will just return you topic ARN.