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:
Endpoint1
toTopicA
Endpoint1
toTopicB
instead ofTopicA
The
delete
method does not searchTopicA
for subscriptions to remove, onlyTopicB
to avoid duplicate subscriptions. This meansEndpoint1
will continue to receive messages fromTopicA
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.