What is an AWS SNS Subscription and what is it used for? Learn the details in this article.
This article is party of my AWS Concept Definitions series. Check out more concepts by clicking here.
Oddly enough, AWS doesn’t define an SNS Subscription in their documentation (that I could find, anyways). But there is this somewhat useful blurb that kind of captures the idea. They say:
“To receive messages published to a topic, you must subscribe an endpoint to the topic. When you subscribe an endpoint to a topic, the endpoint begins to receive messages published to the associated topic.“
This… doesn’t really tell you much about what a subscription is or how it works. Let me try to rephrase this definition for you.
An SNS Subscription is a binding between a SNS topic resource and a receiver. After subscribing, the receiver’s resource will start receiving messages from the topic.
SNS Subscriptions can be modified or removed at any time.
Subscriptions can also be configured to have a Filter Policy attached to it. Filter policies allow the subscriber to only receive a subset of messages. The subscriber can control messages received by specifying a set of Attributes on the message that they are interested in hearing about. The attribute needs to be tagged to the message by the message publisher in order for this to work.
A SNS subscription can be established on the part of the topic owner, or the subscriber. A topic owner can subscribe their topic to a particular resource owner’s ARN. A subscriber can also be granted permission from the owner to subscribe themselves.