AWS SNS-SQS: Checking a subscription already exists
In the end I decided to go another way.
I don't think it was actually a good idea to modify things in that way when the worker boots. It can cause problems because if you have to do some emergency modification of the configuration those changes will be reverted the next time your worker instances restart.
Instead, on boot the worker checks if the queue exists. If the queue does not exist, it will create the queue and all its corresponding configuration including SNS subscriptions etc. It deliberately will only create the SNS subscription for the queue if also creating the queue.
This way, if some configuration has to be changed as an emergency in production, those changes won't be &quot;reset&quot; if the worker spins up new instances.
It is a bit annoying, but also safer I think.
Obviously, this is entirely personal opinion and what I went with in the end - but it seems to have served me relatively well so far. If anyone else has any better ideas or disagrees please do let me know.