Home:ALL Converter>AWS Powershell - Get SNS TOPIC by name

AWS Powershell - Get SNS TOPIC by name

Ask Time:2015-08-21T20:58:48         Author:Michael Clark

Json Formatter

I can't find a way to retreive the SNS topic by name other than doing the following on an already created topic:

$topicarn = New-SNSTopic -Name "$deployedAppVersion-$environment-Events"

The problem with the above is if I get the $deployedAppVersion wrong It's going to create an SNS topic where it shouldn't.

I've looked for a "Get-SNSTopic" but I don't think it exists. The only alternative to what I've got that I can see is a big dirty list of all the topics and searching it for the arn that contains the name I want.

Is there a better way?

Author:Michael Clark,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/32140947/aws-powershell-get-sns-topic-by-name
yy