I'm trying to list all the sns topics that contain local, in a powershell script
I've got this working (finally):
aws sns list-topics --query 'Topics[?contains(TopicArn, `local`)].TopicArn'
Now I want to replace 'local' with a variable
aws sns list-topics --query 'Topics[?contains(TopicArn, $prefix)].TopicArn'
But this doesn't work because the --query parameter expects the filter to be surrounded by back ticks. Also, the whole query parameter needs to be surrounded by single ticks, not double quotes.
How can I achieve this?
You could format the
--querywith format operator(-f).