The SnsSubscription function manages to remove old subscriptions in the current topic when searching for subscriptions here but it does not remove subscriptions if the topic has changed in a stack update.
For example:
- stack update subscribes
Endpoint1 to TopicA
- then stack is updated to subscribe
Endpoint1 to TopicB instead of TopicA
The delete method does not search TopicA for subscriptions to remove, only TopicB to avoid duplicate subscriptions. This means Endpoint1 will continue to receive messages from TopicA until it the subscription is manually deleted by an engineer.
We should update the lambda function to search for subscriptions in the oldTopic and newTopic.
The SnsSubscription function manages to remove old subscriptions in the current topic when searching for subscriptions here but it does not remove subscriptions if the topic has changed in a stack update.
For example:
Endpoint1toTopicAEndpoint1toTopicBinstead ofTopicAThe
deletemethod does not searchTopicAfor subscriptions to remove, onlyTopicBto avoid duplicate subscriptions. This meansEndpoint1will continue to receive messages fromTopicAuntil it the subscription is manually deleted by an engineer.We should update the lambda function to search for subscriptions in the oldTopic and newTopic.