Use Case: Subscription confirmation

Receiving confirmation to a subscription

 

 

If you want to subscribe to any endpoint such as a website or an email to receive messages, the Subscription Arn is unique and different for each user.

Problem

Every time a new user wants to subscribe an endpoint, the AWS SNS generates a new Subscription Arn which needs to be retrieved from the endpoint and used to confirm the subscription. This process in real-time can be resource-intensive and time-consuming if done manually. There is always the chance of a human error in a manual process. Besides, Subscription Arn is in text format which needs to be converted to JSON for an error-free retrieval.

Solution

Using AWS SNS Snap Pack, you can receive a subscription by having a valid topic and an endpoint. Once we have a valid endpoint, Subscribe Topic is used to subscribe an endpoint to a topic. Subscription confirmation is received when a topic is subscribed and the subscription is approved by an endpoint. Once approved, you will receive a Subscription Arn. Here, to confirm the subscription, Email Reader, Filter and Head Snaps are used to filter out the latest Email from the messages received and retrieve the latest topic Arn.

 

Download this Pipeline

Understanding the Solution

Create a topic

The Create Topic Snap is configured with the following attributes and tag attributes. The Snap Settings and output view of the Snap are displayed as follows:

Subscribe to a topic

An endpoint is subscribed to a topic. Here we are using the email-JSON protocol and giving the email ID as an endpoint. The Snap Settings and output view of the Snap are displayed as follows:

Check the endpoint for the confirmation

The Email Reader Snap is used to read the email. The email from the AWS SNS is filtered and the latest email is read by the Filter and Head Snaps. The details such as Topic ARN are retrieved from the email. The Snap Settings and output view of the Snap are displayed as follows:

Filter the messages in the Email

Filter out the latest message received from AWS

Parse the Subscription Arn in text format to JSON format

The Mapper Snap is used to parse the Subscription Arn received in the text to JSON. The Snap Settings and output view of the Snap are displayed as follows:

Select the Subscription Token

Confirm the subscription

The subscription is confirmed with the Topic Arn.

Delete the subscription

The Subscribed topic is deleted.

Delete the topic

The created topic can also be deleted by using Delete Topic Snap.

We can use similar Pipelines for different endpoints and subscribe them to a created topic.

Downloads