I have a stack defined in cdk that consists of an SNS topic in one AWS account and a SQS queue subscribed to the topic in another.
I am worried that there could be a case where the subscription fails or is temporary unavailable (deployments/failed deployments), in which messages would be lost. If the subscription fails the message would be published to the topic but deleted silently since nothing would be subscribed.
This seems like a gap considering SNS + SQS in another AWS account would be a common design pattern.
Questions:
What I ended up doing was adding an alarm on a Math expression NumberOfMessagesPublished - NumberOfNotificationsDelivered
and logging all messages at the source of the event so they are recoverable in the case the subscription is lost.
This is ok for our usecase since this event does not happen a lot so the logging wouldn't be that bad for performance/cost.