mardi 15 août 2023

Allow users to self-subscribe to SNS topic

I currently have a simple dynamoDB stream set up with an sns topic (with a lambda function in between to parse the stream output), to inform interested users on changes to the database.

As interested users grow, adding people manually through the UI is tedious.

I want to create a front-end to allow users to self-subscribe.

Here's my idea so far:

  • have users provide an email to the lambda function, by making an api call to the function from a UI

  • lambda function will use the subscribe action of the sns API and give it the user provided email as an endpoint

  • user confirms the subscription request on their email

I looked for a design pattern on AWS sns topics to provide this solution, but I did not see one for the use case of allowing users to subscribe themselves to topics on AWS's documentation.

Would this system work? Is there a more elegant way I missed?

Aucun commentaire:

Enregistrer un commentaire