Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Receiving confirmation to a subscription

Table of Contents

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.

Image RemovedImage Added

Download this Pipeline

Understanding the Solution

Info

Key Steps

  1. Create a topic

  2. Subscribe an endpoint to a topic

  3. Check the endpoint for the confirmation

  4. Filter the messages in the Email

  5. Filter out the latest message received from AWS

  6. Parse the Subscription Arn in text format to JSON format

  7. Select the Subscription Token

  8. Confirm the subscription

  9. Delete the subscription

  10. Delete the topic

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:

Image RemovedImage RemovedImage AddedImage Added

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:

Image RemovedImage RemovedImage AddedImage Added

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:

Image RemovedImage RemovedImage AddedImage Added

Filter the messages in the Email

Image RemovedImage RemovedImage AddedImage Added

Filter out the latest message received from AWS

Image RemovedImage RemovedImage AddedImage Added

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:

Image RemovedImage RemovedImage AddedImage Added

Select the Subscription Token

Image RemovedImage RemovedImage AddedImage Added

Confirm the subscription

The subscription is confirmed with the Topic Arn.

Image RemovedImage RemovedImage AddedImage Added

Delete the subscription

The Subscribed topic is deleted.

Image RemovedImage RemovedImage AddedImage Added

Delete the topic

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

Image RemovedImage RemovedImage AddedImage Added

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

Downloads

Multiexcerpt include macro
namedownload_instructions
pageOpenAPI

Attachments
previewfalse
patterns*slp