How to create and manage SNS subscriptions
This page shows how to create and manage SNS subscriptions with Scaleway Messaging and Queuing. When you create a subscription to a topic, you are effectively signing up an endpoint to receive all messages published to that topic.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- An existing topic
How to create a subscription
-
Click Messaging in the Serverless section of the Scaleway console side menu. The list of Messaging and Queuing protocols displays.
-
Use the dropdown menu to select the region of the topic you want to create a subscription for.
-
Click SNS, then navigate to the Topics tab and click the topic you want to create a subscription for.
-
Click create subscription. The subscription creation wizard displays:
-
Verify the parameters of the topic that you are creating a subscription for.
-
Choose a protocol, based on the type of endpoint or client you want to subscribe. Click the tab below for further details and full instructions on each protocol:
Select HTTP to create a subscription for a service or web server that can receive
HTTP POST
requests from SNS, via standard HTTP protocol.Note that for security reasons, we recommend using the HTTPS protocol, rather than HTTP.
You are prompted to enter the URL of the HTTP endpoint to subscribe, e.g.
example.com
. Note that the scheme (http://
) is not required.After your HTTP subscription is created, you must confirm it. Find out how in our dedicated documentation.
Select HTTPS to create a subscription for a service or web server that can receive
HTTP POST
requests from SNS, via secure HTTP protocol.You are prompted to enter the URL of the HTTP endpoint to subscribe, e.g.
example.com
. Note that the scheme (https://
) is not required.After your HTTP subscription is created, you must confirm it. Find out how in our dedicated documentation.
Choose Serverless Functions and Containers to create a subscription for a Scaleway Serverless Function or Container that you have created.
You are prompted to select the namespace containing the Function or Container that you want to subscribe. Only namespaces in the same Project and region as the SNS topic can be selected.
You are prompted to select the Serverless Function or Container to subscribe. Only Functions and Containers with a public privacy policy can subscribe to an SNS topic.
-
Click Create subscription to finish.
The subscription is created. If you created an HTTP or HTTPS subscription, you will now need to confirm it, as described below. This step is not required for Serverless Functions or Containers subscriptions.
How to confirm an HTTP or HTTPS subscription
An HTTP or HTTPS subscription will have a Pending
status until you confirm it. This is essential for it to be able to start receiving messages. Follow the steps below to confirm the subscription:
-
Access the subscription’s Settings page (from the console side menu, Messaging > SNS > Topics, click the topic containing the subscription, then click the subscription).
-
Click the Confirm Subscription button at the top right of the page. A pop-up displays:
-
Retrieve the confirmation message that Scaleway SNS sent to your endpoint (delivered as an
HTTP POST
request), and extract theSubscribeURL
from the message payload. -
Enter the
SubscribeURL
value (e.g.https://sns.mnq.{region}.scaleway.com/?Action=ConfirmSubscription&TopicArn={your-topic-arn}&Token={your-subscription-token}
) in the box. The correct values for region, topic ARN and subscription token should be pre-filled for you in the URL. -
Click Confirm subscription.
You are returned to the subscription’s Settings page, where its status is now shown as Confirmed. The subscription will now receive messages published to the topic.
How to delete a subscription
When you no longer want a subscribed endpoint or service to receive messages from the topic, you can delete the subscription.
-
Click Messaging in the Serverless section of the Scaleway console side menu. The list of Messaging and Queuing protocols displays.
-
Use the drop-down menu to select the region containing the subscription you want to delete.
-
Click SNS > Topics, then click the topic containing the subscription you want to delete.
-
Click the Subscriptions tab. The list of subscriptions to this topic displays.
-
Either:
- Click the subscription you wish to delete. The subscription’s Settings page displays. Click the Delete subscription button in the bottom right corner.
- Click the «See more Icon» icon next to the subscription you wish to delete, then select Delete from the menu that displays.
A pop-up asks you to confirm that you understand this action will delete the subscription.
-
Type DELETE and click Delete subscription.