42
votes

I am trying to delete a subscription to an SNS topic (specifically an email address) that is unconfirmed, but the AWS console won't let me. It will let me delete subscriptions that are confirmed however. Any ideas?

5
Also with the API - they cannot be deleted. Anything?Amir Mehler

5 Answers

18
votes

According to SNS architecture and design:

If subscription is APPROVED so no matter whether there is topic associated to it or not. User will be able to delete the subscription.)

If subscription is PENDING so no matter whether there is topic associated to it or not. Amazon will delete automatically the subscription after 3 days of creation.

See the FAQ for more info (scroll down to the question titled "How long will subscription requests remain pending, while waiting to be confirmed?")

5
votes

I have seen email subscriptions hanging around indefinitely in the PendingConfirmation state and as you mention, they can't be deleted using the web console. Also, after a few days the link in the subscription confirmation email expires, so you can't click to confirm the subscription and then delete it either.

However, assuming you still have access to the email address, you can create a new subscription in the web console for the SNS topic using the same email address. This doesn't actually result in a separate subscription as it seems that an email address can only be subscribed once. However, it does send another email with a new confirmation link which you can click to confirm the subscription. Once it's confirmed, you can finally delete the subscription in the SNS web console.

1
votes

I had the problem with an unconfirmed SQS subscription. When deleting the pending subscription, resubscribing the queue resulted in the awkward state that it was subscribed with the deleted pending subscription so no messages would be delivered.

I fixed that by setting up a subscription in the topic's account which triggered a new confirmation message to be send. Once the subscription was confirmed (manually), it replaced the deleted pending subscription and the queue received messages again. Also, the subscription could be fully removed without the deleted pending subscription reappearing.

No idea if a similar approach would work for email subscriptions.

0
votes

I don't think you can, but they should disappear after 3 days if they are not confirmed....so you may just need to wait.

0
votes

If it doesn't disappear after 3 days, try resending the confirmation request by selecting the subscription and clicking "Request confirmations." This will retrigger the 3-day countdown for automatic removal, and it should be removed after 3 days if the subscription is still not confirmed.