diff --git a/menu/navigation.json b/menu/navigation.json index 424fef987d..1f7da4d6b5 100644 --- a/menu/navigation.json +++ b/menu/navigation.json @@ -4304,23 +4304,111 @@ "slug": "queues" }, { - "items": [ - { - "label": "Overview", - "slug": "../serverless-sql-databases" - }, - { - "label": "Concepts", - "slug": "concepts" - }, - { - "label": "Quickstart", - "slug": "quickstart" + "items": [ + { + "label": "Overview", + "slug": "../topics-and-events" + }, + { + "label": "Concepts", + "slug": "concepts" + }, + { + "label": "Quickstart", + "slug": "quickstart" + }, + { + "label": "FAQ", + "slug": "faq" + }, + { + "items": [ + { + "label": "Create credentials", + "slug": "create-credentials" + }, + { + "label": "Manage credentials", + "slug": "manage-credentials" + }, + { + "label": "Create and manage queues", + "slug": "create-manage-topics" + }, + { + "label": "Create and manage subscriptions", + "slug": "create-manage-subscriptions" + }, + { + "label": "Monitor Topics and Events with Cockpit", + "slug": "monitor-topics-cockpit" + } + ], + "label": "How to", + "slug": "how-to" + }, + { + "items": [ + { + "label": "Topics and Events API Reference", + "slug": "https://www.scaleway.com/en/developers/api/messaging-and-queuing/sns-api/" + }, + { + "label": "Connecting Topics and Events to the AWS-CLI", + "slug": "connect-aws-cli" + }, + { + "label": "Using Topics and Events with the AWS-CLI", + "slug": "topics-events-aws-cli" + }, + { + "label": "Using Go, Python or Node.js with Topics and Events", + "slug": "python-node-topics-events" + } + ], + "label": "API/CLI", + "slug": "api-cli" + }, + { + "items": [ + { + "label": "Topics and Events overview", + "slug": "topics-and-events-overview" + }, + { + "label": "Topics and Events - supported actions", + "slug": "topics-and-events-support" + }, + { + "label": "Limitations", + "slug": "limitations" + } + ], + "label": "Additional Content", + "slug": "reference-content" + } + ], + "label": "Topics and Events", + "slug": "topics-and-events" }, { - "label": "FAQ", - "slug": "faq" - }, + "items": [ + { + "label": "Overview", + "slug": "../serverless-sql-databases" + }, + { + "label": "Concepts", + "slug": "concepts" + }, + { + "label": "Quickstart", + "slug": "quickstart" + }, + { + "label": "FAQ", + "slug": "faq" + }, { "items": [ { diff --git a/pages/topics-and-events/api-cli/connect-aws-cli.mdx b/pages/topics-and-events/api-cli/connect-aws-cli.mdx new file mode 100644 index 0000000000..c668b41f28 --- /dev/null +++ b/pages/topics-and-events/api-cli/connect-aws-cli.mdx @@ -0,0 +1,128 @@ +--- +meta: + title: Connecting Topics and Events to the AWS-CLI + description: This page explains how to connect Scaleway Topics and Events to the AWS-CLI +content: + h1: Connecting Topics and Events to the AWS-CLI + paragraph: This page explains how to connect Scaleway Topics and Events to the AWS-CLI +tags: messaging sns aws-cli cli aws sdk python boto +categories: + - messaging +dates: + validation: 2025-04-10 + posted: 2023-01-04 +--- + +The AWS-CLI is an open-source tool built on top of the AWS SDK for Python (Boto) that provides commands for interacting with AWS services. With minimal configuration, you can start using the AWS-CLI with Scaleway Topics and Events. This allows you to create, list and manage your topics, send messages and much more, all from your command line. + +This guide shows you how to install the AWS-CLI and configure it to connect to Scaleway Topics and Events. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization +- Valid [credentials](/topics-and-events/how-to/create-credentials/) for Topics and Events + + + This page assumes you will use the AWS-CLI v1. + + +## How to install the AWS-CLI + +To interact with Scaleway Topics and Events, both `aws-cli` and `awscli-plugin-endpoint` need to be installed. The `awscli-plugin-endpoint` is a useful plugin to help people more easily access third-party providers such as Scaleway. + +Install both `aws-cli` and `awscli-plugin` using `pip`. + +``` +pip3 install awscli +pip3 install awscli-plugin-endpoint +``` + +## How to configure the AWS-CLI + +Now you have installed the AWS-CLI, you need to configure it for use with Scaleway Topics and Events. + +1. Create a file named `~/.aws/config` by running the following command: + ``` + aws configure set plugins.endpoint awscli_plugin_endpoint + ``` + + + With the most recent versions of awscli (1.29.0 or 2.13.0), the use of a plugin is not necessary. If you are using one of those versions and wish to skip this step, you can do so. Note that this will also affect your configuration file in the next step. + + +2. Open the `~/.aws/config` file you just created in a text editor and edit it as follows (the Topics and Events (SNS) endpoint URLs can be found in the console on the **Settings** page for your Topics and Events service). + ``` + [plugins] + endpoint = awscli_plugin_endpoint + [profile sns] + region = fr-par + sns = + endpoint_url = https://sns.mnq.fr-par.scaleway.com + ``` + + Optionally, you can also configure additional profiles by adding new blocks under `[sns]`. For example, you can add a profile for `[sqs]` if you are also using Scaleway Queues, or another profile, `[profile aws]`, to connect to the AWS SQS/SNS service if you want: + + ``` + [plugins] + endpoint = awscli_plugin_endpoint + [profile sns] + region = fr-par + sns = + endpoint_url = https://sns.mnq.fr-par.scaleway.com + [profile sqs] + region = fr-par + sqs = + endpoint_url = https://sqs.mnq.fr-par.scaleway.com + [profile aws] + region=eu-west-3 + output=json + ``` + + + If you are using the AWS-CLI v2, you must include the path to the plugin in your configuration file. Add `cli_legacy_plugin_path = ` to the `[plugins]` section, replacing `` with the corresponding path. + + + + If you are using aws 1.29.0 or 2.13.0 without the plugin, your configuration file should be as follows: + ``` + [profile sns] + region = fr-par + endpoint_url = https://sns.mnq.fr-par.scaleway.com + ``` + + + +3. Generate a credentials file using the following command: + ``` + aws configure + ``` +** +4. Open the `~/.aws/credentials` file you just created, and add the access key and secret key you saved when you generated your [credentials](/topics-and-events/how-to/create-credentials/): + ``` + [topics_events] + aws_access_key_id= + aws_secret_access_key= + ``` + + If you have other profiles, you can add a block to indicate their credentials too: + ``` + [queues] + aws_access_key_id= + aws_secret_access_key= + + [aws] + aws_access_key_id= + aws_secret_access_key= + ``` + +5. Test that everything is set up correctly with the following command: + ``` + aws topics_events list-topics + ``` + + Use the `--profile` option if you want to test it using a different profile. + + + Check out our dedicated documentation to find more common commands for getting started with the AWS CLI. The [Topics and EVents guide](/queues/api-cli/topics-events-aws-cli/) walks you through creating and listing topics, sending messages. + diff --git a/pages/topics-and-events/api-cli/index.mdx b/pages/topics-and-events/api-cli/index.mdx new file mode 100644 index 0000000000..072212e100 --- /dev/null +++ b/pages/topics-and-events/api-cli/index.mdx @@ -0,0 +1,8 @@ +--- +meta: + title: Topics and Events - API/CLI Documentation + description: Topics and Events API/CLI Documentation +content: + h1: Topics and Events - API/CLI Documentation + paragraph: Topics and Events API/CLI Documentation +--- diff --git a/pages/topics-and-events/api-cli/python-node-topics-events.mdx b/pages/topics-and-events/api-cli/python-node-topics-events.mdx new file mode 100644 index 0000000000..29a76340bb --- /dev/null +++ b/pages/topics-and-events/api-cli/python-node-topics-events.mdx @@ -0,0 +1,422 @@ +--- +meta: + title: Using Go, Python or Node.js with Topics and Events + description: This page explains how to use Go, Python or Node.js with Topics and Events and provides code samples +content: + h1: Using Go, Python or Node.js with Topics and Events + paragraph: This page explains how to use Go, Python or Node.js with Topics and Events and provides code samples +tags: messaging boto3 python nodejs sns go topics-events +categories: + - messaging +dates: + validation: 2024-10-18 + posted: 2023-01-04 +--- + +AWS provides a number of **S**oftware **D**evelopment **K**its (SDKs) which provide language-specific APIs for AWS services, including [SNS](/topics-and-events/concepts/#sns), which is the protocol that Scaleway Topics and Events is based on. + +- AWS provides a dedicated [SDK for Go](https://aws.amazon.com/sdk-for-go/). +- The [AWS SDK for Python](https://aws.amazon.com/sdk-for-python/) is Boto3. +- For Node.js, use the [AWS SDK for JavaScript](https://aws.amazon.com/sdk-for-javascript/), which can be [installed from NPM](https://github.com/aws/aws-sdk-js-v3#getting-started). + +This page provides code samples to show you how to get started using these SDKs with Scaleway Topics and Events. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization +- Valid [credentials](/topics-and-events/how-to/create-credentials/) for Topics and Events +- Installed the relevant AWS SDK [for Go](https://aws.amazon.com/sdk-for-go/), [Python](https://aws.amazon.com/sdk-for-python/) and/or [JavaScript](https://aws.amazon.com/sdk-for-javascript/) + +## Go + +### Connect to Topics and Events (Go) + +The following code shows you how to connect to Scaleway Topics and Events: + +```go +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/sns" +) + +func main() { + awsSession := session.Must(session.NewSession(&aws.Config{ + Region: aws.String("fr-par"), + Endpoint: aws.String("http://sns.mnq.fr-par.scaleway.com"), + Credentials: credentials.NewStaticCredentials(AwsAccessKey, AwsSecretKey, ""), + })) + + awsSns := sns.New(awsSession) + + [...] +} +``` + + + + The `Endpoint` for Scaleway Topics and Events is `https://sns.mnq.fr-par.scaleway.com`. The values for the access and secret keys should be the credentials you [generated](/topics-and-events/how-to/create-credentials/) for Topics and Events. + + + +Once connected, you can use any of the SDK's available functions. Be aware though that some functions are not [supported by Scaleway Topics and Events](/topics-and-events/reference-content/sns-support/), so make sure to check the link for more details on these. See the [official SDK documentation](https://pkg.go.dev/github.com/aws/aws-sdk-go/service/sns) for more information on getting started with the SDK, or keep reading for some code examples. + +### Create a topic (Go) + +```go +createTopicResponse, _ := awsSNS.CreateTopic(&sns.CreateTopicInput{ + Name: aws.String("my-test-topic"), +}) +fmt.Println(*createTopicResponse.TopicArn) +``` + +### Publish messages to this topic (Go) + +Be careful: messages sent to topics with no subscriptions are automatically deleted. + +```go +for i := 0; i < 10; i++ { + _, _ = awsSNS.Publish(&sns.PublishInput{ + Message: aws.String(fmt.Sprintf("Hello World: %d", i)), + TopicArn: createTopicResponse.TopicArn, + }) +} +``` + +### Create subscriptions to this topic (Go) + +#### Subscribe to a public Scaleway function + +This code triggers the function each time a message is published to the topic. + +You can find the value for `[Function URL]` in the [Scaleway console](https://console.scaleway.com) in the **Endpoints** tab of your function's **Overview** page. + +```go +_, _ = awsSns.Subscribe(&sns.SubscribeInput{ + Endpoint: aws.String(FunctionUrl), + Protocol: aws.String("lambda"), + TopicArn: createTopicResponse.TopicArn, +}) + +#### Subscribe to an HTTP/S endpoint + +```go +_, _ = awsSns.Subscribe(&sns.SubscribeInput{ + Endpoint: aws.String(Url), + Protocol: aws.String("http"), // or https + TopicArn: createTopicResponse.TopicArn, +}) +``` + +The HTTP server should receive an HTTP request with a body in json matching the following format: + +```json +{ +"Type": "SubscriptionConfirmation", +"Token": "", +"MessageId": "", +"TopicArn": "arn:scw:sns:fr-par::MyTopic", +"Message": "You have chosen to subscribe to the topic arn:scw:sns:fr-par::MyTopic.\nTo confirm the subscription, visit the SubscribeURL included in this message.", +"Timestamp": "2022-06-29T10:03:34Z", +"SignatureVersion": "1", +"Signature": "", +"SigningCertURL": "https://messaging.s3.fr-par.scw.cloud/fr-par/sns/sns_certificate_[certSerialNumber].crt", +"SubscribeURL": "" // Get the confirmation link located here +} +``` + +The signing certificate of the message is in the JSON of the `SigningCertURL`. This certificate is also signed by the [trust chain certificate](https://messaging.s3.fr-par.scw.cloud/fr-par/sns/sns-trust-chain.pem) (common name `sns.mnq.srr.scw.cloud`). For more information about verifying the authenticity of the message, refer to the official [AWS documentation](https://docs.aws.amazon.com/sns/latest/dg/sns-verify-signature-of-message.html). + +To confirm the subscription, make a request to the `SubscribeURL` using your browser or curl. + +### Delete all subscriptions (Go) + +```go +listSubscriptions, _ := awsSns.ListSubscriptionsByTopic(&sns.ListSubscriptionsByTopicInput{ + TopicArn: createTopicResponse.TopicArn, +}) +for _, sub := range listSubscriptions.Subscriptions { + awsSns.Unsubscribe(&sns.UnsubscribeInput{ + SubscriptionArn: sub.SubscriptionArn, + }) +} +``` + +## Python + +### Connect to Topics and Events (Python) + +The following code shows you how to connect to Topics and Events using Boto3's `resource()`. You could also use `client()`, but we favor `resource()` as it is more pythonesque: + +```python +sns = boto3.resource('sns', + endpoint_url=[], + aws_access_key_id=[], + aws_secret_access_key=[], + region_name='fr-par') +``` + + + The `endpoint_url` for Scaleway Topics and Events (based on SNS) is `https://sns.mnq.fr-par.scaleway.com`. The values for the access and secret keys should be the credentials you [generated](/topics-and-events/how-to/create-credentials/) for Topics and Events. + + +Once connected, you can use any of the SDK's available functions. However, some functions are not [supported by Scaleway Topics and Events](/topics-and-events/reference-content/sns-support/), so do check the link to make sure. See the [official SDK documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html) for more information, or keep reading for some code examples. + +### Create a topic (Python) + +```python +# Create a topic. This returns an SNS.Topic instance +topic = sns.create_topic(Name='test') # You can now access identifiers and attributes +print(topic.arn) +print(topic.attributes) +``` + +### Publish messages to this topic (Python) + +Be careful: messages sent to topics with no subscriptions are automatically deleted. + +```python +for i in range (0,10): + topic.publish(Message="Hello World: "+str(i)) +``` + +### Create subscriptions to this topic (Python) + +#### Subscribe to a public Scaleway function + +This code triggers the function each time a message is published to the topic. + +You can find the value for `[Function URL]` in the [Scaleway console](https://console.scaleway.com) in the **Endpoints** tab of your function's **Overview** page. + +```python +subscription_functions = topic.subscribe( + Protocol='lambda', + Endpoint=[Function URL], + ReturnSubscriptionArn=True +) +``` + +```python +subscription_functions = topic.subscribe( + Protocol='lambda', + Endpoint=[Function URL], + ReturnSubscriptionArn=True, + Attributes={ + 'RedrivePolicy': '{"deadLetterTargetArn": "[Queue ARN]"}' + } +) +``` + +#### Subscribe to an HTTP/S endpoint + +```python +subscription = topic.subscribe( + Protocol='http', //or https + Endpoint=url, + ReturnSubscriptionArn=True +) +``` + +The HTTP server should receive an HTTP request with a body in json matching the following format: + +```json +{ +"Type": "SubscriptionConfirmation", +"Token": "", +"MessageId": "", +"TopicArn": "arn:scw:sns:fr-par::MyTopic", +"Message": "You have chosen to subscribe to the topic arn:scw:sns:fr-par::MyTopic.\nTo confirm the subscription, visit the SubscribeURL included in this message.", +"Timestamp": "2022-06-29T10:03:34Z", +"SignatureVersion": "1", +"Signature": "", +"SigningCertURL": "http:///SNStest.crt", +"SubscribeURL": "" // Get the confirmation link located here +} +``` + +To confirm the subscription, make a request to the `SubscribeURL` using your browser or curl. + +### Delete all subscriptions (Python) + +```python +for subs in topic.subscriptions.all(): + subs.delete() +``` + +## Node.js + +### Connect to Topics and Events (NodeJS) + +The following code sample shows how to connect to Topics and Events: + +```javascript +import { + CreateTopicCommand, + DeleteTopicCommand, + ListSubscriptionsByTopicCommand, + ListTopicsCommand, + PublishCommand, + SNSClient, + SubscribeCommand, + UnsubscribeCommand, + } from "@aws-sdk/client-sns"; + +var snsClient = new SNSClient({ + credentials : { + accessKeyId : "", + secretAccessKey: "" + }, + region: "par", + endpoint: "https://sns.mnq.fr-par.scaleway.com", + +}) + +``` + + + The `endpoint_url` for Scaleway Topics and Events is `https://sns.mnq.fr-par.scaleway.com`. For the access and secret key values, use the credentials you [generated](/topics-and-events/how-to/create-credentials/) for Topics and Events. + + +Once connected, you can use any of the SDK's available functions. However, some functions are not [supported by Scaleway Topics and Events](/topics-and-events/reference-content/sns-support), so do check the link to make sure. See the [official SDK documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sns/) for more information, or keep reading for some code examples. + +### Create a topic (NodeJS) + +You can find all available parameters for `createTopic` in the [AWS documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sns/classes/createtopiccommand.html). + +```javascript +var paramsTopic = { + Name: 'MyTopic' + }; +const commandCreateTopic = new CreateTopicCommand(paramsTopic); +const restCreateTopic = await snsClient.send(commandCreateTopic); +const topicARN= restCreateTopic.TopicArn; +console.log(topicARN); +``` + +### Publish messages to this topic (NodeJS) + +Be careful: messages sent to topics with no subscriptions are automatically deleted. + +This code sample demonstrates how to send a message with `MessageAttributes`. For more information on MessageAttributes, refer to [the official documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sns/classes/publishcommand.html). + +```javascript +var paramsSend = { + Message: 'MyMessage', + Subject: 'MySubject', + TopicArn: topicARN, + }; +const commandPublishCommand = new PublishCommand(paramsSend); +const restPublishCommand = await snsClient.send(commandPublishCommand); +console.log(restPublishCommand.MessageId); +``` + +### Subscribe to a topic (NodeJS) + +You can find all available parameters for the subscribe operation in the [AWS documentation] (https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sns/classes/subscribecommand.html) + +#### Subscribe to a public Scaleway function + +This code triggers the function each time a message is published to the topic. + +You can find the value for `[Function URL]` in the [Scaleway console](https://console.scaleway.com) in the **Endpoints** tab of your function's **Overview** page. + +```javascript +var params = { + Protocol: 'lambda', + TopicArn: topicARN, + Endpoint: 'YOUR FUNCTION ENDPOINT', + ReturnSubscriptionArn: true + }; +const command = new SubscribeCommand(params); +const rest = await snsClient.send(command); +console.log(rest.SubscriptionArn); +``` + +#### Subscribe to an HTTP/S endpoint + +```javascript +var paramsHttpsSubscription = { + Protocol: 'https', + TopicArn: topicARN, + Endpoint: 'YOUR SERVER ENDPOINT', + ReturnSubscriptionArn: true + }; +const commandHttpsSubscription = new SubscribeCommand(paramsHttpsSubscription); +const restHttpsSubscription = await snsClient.send(commandHttpsSubscription); +console.log(restHttpsSubscription.SubscriptionArn); + +``` +The HTTP server receives an HTTP request with a `json` body matching the following format: + +```json +{ +"Type": "SubscriptionConfirmation", +"Token": "", +"MessageId": "", +"TopicArn": "arn:scw:sns:fr-par::MyTopic", +"Message": "You have chosen to subscribe to the topic arn:scw:sns:fr-par::MyTopic.\nTo confirm the subscription, visit the SubscribeURL included in this message.", +"Timestamp": "2022-06-29T10:03:34Z", +"SignatureVersion": "1", +"Signature": "", +"SigningCertURL": "http:///SNStest.crt", +"SubscribeURL": "" // Get the confirmation link located here +} +``` + +To confirm the subscription, make a request to the `SubscribeURL` using your browser or curl. + +### Delete all subscriptions (NodeJS) + +The following code sample deletes all subscriptions to a topic. + +```javascript +var paramsListSubs = { + TopicArn: topicARN, + }; +const commandListSubs = new ListSubscriptionsByTopicCommand(paramsListSubs); +const restListSubs = await snsClient.send(commandListSubs); +const subscriptionsList = restListSubs.Subscriptions; +subscriptionsList.forEach(async function (element) { +try { + var params = { + SubscriptionArn: element.SubscriptionArn + }; + const command = new UnsubscribeCommand(params) + const rest = await snsClient.send(command) + console.log("Unsubscribing : ",rest.$metadata.httpStatusCode) + +} catch (e) { + throw new Error(e.message) +} +}); + +``` + +### Delete all topics (NodeJS) + +The following code sample deletes all your topics. + +```javascript +// First List Topics +const commandList = new ListTopicsCommand({}); +const restTopicList = await snsClient.send(commandList); +const TopicList = restTopicList.Topics + +// For Each Topic in the list, apply the Delete Topic Command +TopicList.forEach(async function (element) { + try { + var params = { + TopicArn: element.TopicArn + }; + const command = new DeleteTopicCommand(params) + const rest = await snsClient.send(command) + console.log("Deleting : ",rest.$metadata.httpStatusCode) + + } catch (e) { + throw new Error(e.message) + } + }); + +``` diff --git a/pages/topics-and-events/api-cli/topics-events-aws-cli.mdx b/pages/topics-and-events/api-cli/topics-events-aws-cli.mdx new file mode 100644 index 0000000000..a61b719a4a --- /dev/null +++ b/pages/topics-and-events/api-cli/topics-events-aws-cli.mdx @@ -0,0 +1,147 @@ +--- +meta: + title: Using Scaleway Topics and Events with the AWS-CLI + description: This page explains how to use Scaleway Topics and Events for creating topics and sending and receiving messages with the AWS CLI +content: + h1: Using Scaleway Topics and Events with the AWS-CLI + paragraph: This page explains how to use Scaleway Topics and Events for creating topics and sending and receiving messages with the AWS CLI +tags: messaging sns aws-cli cli aws messages subscribe publish topics +categories: + - messaging +dates: + validation: 2025-04-10 + posted: 2023-04-04 +--- + +The AWS-CLI is an open-source tool built on top of the AWS SDK for Python (Boto) that provides commands for interacting with AWS services. Once you have [connected Scaleway Topics and Events to the AWS-CLI](/topics-and-events/api-cli/connect-aws-cli/), you can start creating, listing and managing your topics, sending messages and much more, all from your command line. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization +- Valid [credentials](/topics-and-events/how-to/create-credentials/) for Topics and Events +- [Connected Topics and Events to the AWS-CLI](/topics-and-events/api-cli/connect-aws-cli/) +- [jq](https://stedolan.github.io/jq/download/) installed on your machine + + +## Getting started with Topics and Events + +1. Use the following command to create a topic: + + ```sh + aws sns create-topic --name MyTopic | tee my-topic.json + ``` + +2. Use the following command to list existing topics: + + ```sh + aws sns list-topics + ``` + +## Preparing and subscribing to an HTTP/HTTPS target for Topics and Events messages + +1. Get the public endpoint of the HTTP server you want to forward your messages to. + +2. Use the following command to configure a subscription to push each new message sent on the topic to the HTTP server: + + ```sh + aws sns subscribe --topic-arn $(jq -r .TopicArn my-topic.json) --protocol http --notification-endpoint | tee my-subscription.json + ``` + +3. Find the HTTP request received by the HTTP server. It should have a body in JSON matching the following format. It contains the information necessary to complete the subscription process: + + ```json + { + "Type": "SubscriptionConfirmation", + "Token": "", + "MessageId": "", + "TopicArn": "arn:scw:sns:fr-par::MyTopic", + "Message": "You have chosen to subscribe to the topic arn:scw:sns:fr-par::MyTopic.\nTo confirm the subscription, visit the SubscribeURL included in this message.", + "Timestamp": "2022-06-29T10:03:34Z", + "SignatureVersion": "1", + "Signature": "", + "SigningCertURL": "http:///SNStest.crt", + "SubscribeURL": "" // Get the confirmation link located here + } + ``` + +4. Use the following command to confirm the subscription: + + ```sh + curl "" + ``` + +## Preparing and subscribing to a lambda (Scaleway Serverless Functions) target for Topics and Events messages + +1. Create the function following the steps detailed in the [Scaleway Functions Quickstart](/serverless-functions/quickstart/). + +2. Get the function endpoint from the [Scaleway console](https://console.scaleway.com/functions) under "Functions" -> "[YOUR-FUNCTION-NAMESPACE]" -> "[YOUR-FUNCTION-NAME]" -> "Function Settings" tab -> "Function Endpoint" + + + Only the main generated endpoint of the function will work, not the aliases. The endpoint should match the following format: + + ```sh + https://-.functions.fnc.fr-par.scw.cloud + example: "https://mynamespacexxxxxxxx-myfunction.functions.fnc.fr-par.scw.cloud)" + ``` + + +3. Use the following command to configure a subscription to push each new message sent on this topic to the function: + + ```sh + aws sns subscribe --topic-arn $(jq -r .TopicArn my-topic.json) --protocol lambda --notification-endpoint | tee my-subscription.json + + ``` + +## Continuing with Topics and Events + +1. Use the following command to list subscriptions: + + ```sh + aws sns list-subscriptions + ``` + +2. Use the following command to publish a message on the topic: + + ```sh + aws sns publish --topic-arn $(jq -r .TopicArn my-topic.json) --message "Hello world!" --message-deduplication-id $(date +%s) + ``` + +3. Use the following command to read the message received on a **Scaleway Queues** target: + + + - For **HTTP**/**HTTPS** targets, you should have received the message on your server + - For **lambda** targets, your function should have been called with the message as argument + + + ```sh + aws sqs receive-message --queue-url $(jq -r .QueueUrl my-queue.json) | tee message1.json + ``` + +4. Use the following command to delete the message received on a **Scaleway Queues** target. This is necessary to prevent it from being re-queued: + + ```sh + aws sqs delete-message --queue-url $(jq -r .QueueUrl my-queue.json) --receipt-handle $(jq -r .Messages[0].ReceiptHandle message1.json) + ``` + +5. Use the following command to delete the subscription: + + ```sh + aws sns unsubscribe --subscription-arn $(jq -r .SubscriptionArn my-subscription.json) + ``` + +6. Use the following command to delete the Scaleway queue (if you had a Scaleway Queues target): + + ```sh + aws sqs delete-queue --queue-url $(jq -r .QueueUrl my-queue.json) + ``` + + + For **lambda**, delete the function (if necessary), using the [Scaleway console](https://console.scaleway.com/functions) + + +7. Use the following command to delete the topic: + + ```sh + aws sns delete-topic --topic-arn $(jq -r .TopicArn my-topic.json) + ``` diff --git a/pages/topics-and-events/assets/scaleway-topics-create-subs.webp b/pages/topics-and-events/assets/scaleway-topics-create-subs.webp new file mode 100644 index 0000000000..f9aec9f4b7 Binary files /dev/null and b/pages/topics-and-events/assets/scaleway-topics-create-subs.webp differ diff --git a/pages/topics-and-events/assets/scaleway-topics-create-topic.webp b/pages/topics-and-events/assets/scaleway-topics-create-topic.webp new file mode 100644 index 0000000000..7596cd2e15 Binary files /dev/null and b/pages/topics-and-events/assets/scaleway-topics-create-topic.webp differ diff --git a/pages/topics-and-events/assets/scaleway-topics-gen-creds.webp b/pages/topics-and-events/assets/scaleway-topics-gen-creds.webp new file mode 100644 index 0000000000..9fdca24183 Binary files /dev/null and b/pages/topics-and-events/assets/scaleway-topics-gen-creds.webp differ diff --git a/pages/topics-and-events/concepts.mdx b/pages/topics-and-events/concepts.mdx new file mode 100644 index 0000000000..061970e68e --- /dev/null +++ b/pages/topics-and-events/concepts.mdx @@ -0,0 +1,91 @@ +--- +meta: + title: Topics and Events - Concepts + description: Understand the core concepts of Scaleway Topics and Events. Explore fundamental principles for efficient message handling and service optimization. +content: + h1: Topics and Events - Concepts + paragraph: Understand the core concepts of Scaleway Topics and Events. Explore fundamental principles for efficient message handling and service optimization. +categories: + - +tags: messaging topics subscriptions events +dates: + validation: 2025-04-10 + posted: 2025-04-10 +--- + +## Content-based deduplication + +Content-based deduplication is a setting available for [FIFO](#fifo) topics. Enable content-based deduplication if the message body is guaranteed to be unique for each message. A unique hash value is generated from the body of each message, which is used as its deduplication ID. This avoids the need to set a deduplication ID when sending messages. Read more in our dedicated documentation on [creating topics](/topics-and-events/how-to/create-manage-topics/). + +## Credentials + +Credentials give services and platforms access to Topics and Events, enabling them to connect to the host system. Credentials for Scaleway Topics and Events define whether the bearer is allowed to write, and/or read, and/or manage topics and subscriptions. Refer to our [credentials documentation](/topics/how-to/create-credentials/) for more information. + +## FIFO + +FIFO stands for **F**irst **I**n **F**irst **O**ut, and represents a type of topic where the exact order of messages is preserved, and duplicate messages are not tolerated. As well as these specificities, FIFO topics support all the same features as the [Standard](#standard) type. Consider using FIFO topics for any use cases where the order of messages is critical, such as e-commerce order management systems, systems where one action should not happen until another has been completed, or first-come-first-served ticketing systems. + +## Filtering + +In a [topic-based](#topic-based) system, where topics handle the logic, filtering is similar to routing. Messages are sent to defined topics, which can be thought of as filters, as subscribers can subscribe only to the topics they are interested in. In a [content-based](#content-based) system, filtering is carried out more directly by subscribers, who define filters for messages based on the content/attributes they want to receive. + +## Message broker + +A message broker is a piece of software that allows applications, systems, and services to communicate with each other and send/receive data. It facilitates the exchange of information by receiving messages from a producer and transmitting them to a consumer. Scaleway Topics and Events is a message broker tool based on the AWS SNS messaging system. + +## Messaging and Queuing + +Previously, Scaleway Messaging and Queuing was a single product that grouped together three different messaging protocols. It has now been split into three distinct products: [NATS](/nats/), [Queues](/queues), and [Topics and Events](/topics-and-events/). + +## Publish/Subscribe + +Also known as "pub/sub", the publish/subscribe model provides a pattern or framework for the exchange of messages between publishers and subscribers. It contrasts with the [queuing](/queues/concepts/#queuing) model. The key feature of publish/subscribe is that messages are not sent to defined recipients. Instead, subscribers define the types of message they are interested in, and only receive messages matching their criteria. The publisher sends the message without knowing exactly who will receive it. + +## Region + +Topics and Events is available in multiple regions. A region designates the geographical area where the service is hosted. Refer to the [product availability table](/account/reference-content/products-availability/) to check which regions are available for Topics and Events. + +When creating topics, you need to do this on a region-by-region basis. The region drop-down in the console allows you to switch between available regions. + +## SNS + +Scaleway Topics and Events is based on the AWS SNS protocol. **S**imple **N**otification **S**ervice, or SNS, is a [publish/subscribe](#publishsubscribe) notification service for the mass delivery of messages. SNS acts as a single message bus that can be sent to a variety of devices and platforms through a single code interface. It is also possible to adapt message formats to the particular needs of each platform. + +## Standard + +Standard-type topics represent the default topic type, and offer an at-least-once message delivery system. Unlike [FIFO](#fifo) topics, standard topics provide only best-effort attempts to deliver messages in order. At-least-once delivery means that it is possible under rare circumstances that the same message may be received more than once. + +## Subscriber + +In [Topics and Events](#topics-and-events), a subscriber is the entity (e.g. a queue, function, or URL) that messages from topics are pushed to. Subscribers can filter messages based on their topic or content. + +## Subscription + +A subscription is a connection between a client or endpoint, and a topic. By creating a subscription, the subscribed endpoint receives messages and notifications published to the topic. You can [create subscriptions](/topics-and-events/how-to/create-manage-subscriptions/) for HTTP/S endpoints, Scaleway queues, and Scaleway Serverless [Functions](/serverless-functions/quickstart/) and [Containers](/serverless-containers/quickstart/). + +## Subscription protocols and endpoints + +A subscription protocol refers to the communication method used to deliver messages to a subscriber. Different types of subscribers require different protocols. When you create a new subscription to a topic with Scaleway Topics and Events, the following options are available: + +| Protocol | Endpoint / Client | Note | +|-------------------------------------|--------------------------------------------------|-----------------------------------| +| HTTP | The URL of a service or web server that can receive notifications (HTTP POST requests) from Topics and Events, e.g. `http://example.fr` | - For security reasons, we recommend using the HTTPS protocol rather than HTTP.
- HTTP subscriptions must be [confirmed](/topics-and-events/how-to/create-manage-subscriptions/#how-to-confirm-an-http-or-https-subscription) after creation | +| HTTPS | The URL of a service or web server that can receive notifications (HTTPS POST requests) from Topics and Events, e.g. `https://example.fr` | - HTTPS subscriptions must be [confirmed](/topics-and-events/how-to/create-manage-subscriptions/#how-to-confirm-an-http-or-https-subscription) after creation | +| Serverless Functions and Containers | A Scaleway Serverless [Function](/serverless-functions/quickstart/) or [Container](/serverless-containers/quickstart/)
| - It must have a [public](/serverless-functions/concepts/#privacy-policy) privacy policy
- It must be in a [namespace](/serverless-functions/concepts/#namespace) from the same [Project](/organizations-and-projects/concepts/#project) and [region](#region) as the topic | +| Queues | A Scaleway [queue](/queues/)
| - It must be in the same [Project](/organizations-and-projects/concepts/#project) and [region](#region) as the topic | + +## Topic + +A topic is a communication channel used to send messages and notifications to subscribed endpoints or clients. Publishers send messages to topics, and those messages are received by subscribers. Subscribers can include Serverless Functions, Scaleway Queues and HTTP/HTTPS endpoints. As such, topics decouple the publishing and the receiving of messages, allowing for flexibility and scalability in building loosely-coupled systems. + +## Topic types + +When creating topics with Scaleway Topics and Events, two topic types are available. [Standard](#standard) topics provide at-least-once delivery, while [FIFO](#fifo) topics offer first-in-first-out delivery, and (unlike Standard topics) guarantee that messages are delivered in order and without duplication. [Content-based deduplication](#content-based-deduplication) is only available for FIFO topic types. Find out more about creating topics with our [dedicated documentation](/topics-and-events/how-to/create-manage-topics/). + +## Topic volume + +Topic volume is one of the factors affecting the billing of Scaleway Topics and Events. Topic volume is calculated as the total sum of the sizes of all messages sent from a topic to its subscriptions. + +## Topics and Events + +Scaleway Topics and Events is a product for creating managed messaging topics based on the [SNS](#sns) protocol. Previously, it was part of the Messaging and Queuing product. diff --git a/pages/topics-and-events/faq.mdx b/pages/topics-and-events/faq.mdx new file mode 100644 index 0000000000..6c4af903bd --- /dev/null +++ b/pages/topics-and-events/faq.mdx @@ -0,0 +1,34 @@ +--- +meta: + title: Topics and Events FAQ + description: Discover Scaleway Topics and Events, and get answers to common questions about the different protocols available, compatibility with various services, and billing. +content: + h1: Topics and Events FAQ +dates: + validation: 2025-04-10 +category: serverless +productIcon: SnsProductIcon +--- + +## What is Topics and Events? + +Scaleway Topics and Events is a product for creating managed messaging topics based on the AWS SNS protocol. Previously, it was part of the Messaging and Queuing product. + +## What is SNS? + +**S**imple **N**otification **S**ervice, or SNS, is a [publish/subscribe](/topics-and-events/concepts/#publishsubscribe) notification service for the mass delivery of messages. SNS acts as a single message bus that can be sent to a variety of devices and platforms through a single code interface. It is also possible to adapt message formats to the particular needs of each platform. + +## Does Scaleway Topics and Events support all SNS features? + +The following subscriber types are supported: +- HTTP/S clients +- Serverless Functions and Containers +- Scaleway Queues + +For more details on supported and unsupported Topics and Events features, see our [dedicated page](/tpoics-and-events/reference-content/sns-support/). + +## How is Topics and Events billed? + +Billing is based on [topic volume](/topics-and-events/concepts/#topic-volume) (the total sum of each message's size going out from the topic to the subscriptions). + +For full pricing details, see our [dedicated pricing page](https://www.scaleway.com/en/pricing/). \ No newline at end of file diff --git a/pages/topics-and-events/how-to/assets/scaleway-topics-create-subs.webp b/pages/topics-and-events/how-to/assets/scaleway-topics-create-subs.webp new file mode 100644 index 0000000000..f9aec9f4b7 Binary files /dev/null and b/pages/topics-and-events/how-to/assets/scaleway-topics-create-subs.webp differ diff --git a/pages/topics-and-events/how-to/assets/scaleway-topics-create-topic.webp b/pages/topics-and-events/how-to/assets/scaleway-topics-create-topic.webp new file mode 100644 index 0000000000..7596cd2e15 Binary files /dev/null and b/pages/topics-and-events/how-to/assets/scaleway-topics-create-topic.webp differ diff --git a/pages/topics-and-events/how-to/assets/scaleway-topics-gen-creds.webp b/pages/topics-and-events/how-to/assets/scaleway-topics-gen-creds.webp new file mode 100644 index 0000000000..9fdca24183 Binary files /dev/null and b/pages/topics-and-events/how-to/assets/scaleway-topics-gen-creds.webp differ diff --git a/pages/topics-and-events/how-to/create-credentials.mdx b/pages/topics-and-events/how-to/create-credentials.mdx new file mode 100644 index 0000000000..a308d758ab --- /dev/null +++ b/pages/topics-and-events/how-to/create-credentials.mdx @@ -0,0 +1,49 @@ +--- +meta: + title: How to create Topics and Events + description: Learn how to create credentials for Scaleway Topics and Events. Securely manage access and ensure seamless integration with this step-by-step guide. +content: + h1: How to create credentials for Scaleway Topics and Events + paragraph: Learn how to create credentials for Scaleway Topics and Events. Securely manage access and ensure seamless integration with this step-by-step guide. +tags: credentials messaging queuing key token +categories: + - serverless +dates: + validation: 2025-04-10 + posted: 2025-04-10 +--- + +This page shows how to create [credentials](/topics-and-events/concepts/#credentials) for Scaleway Topics and Events. Credentials give their bearer (e.g. services and platforms) access to your service. + +Credentials for Topics and Events are granular: you can define the level of access that they should give. Credentials give the specified level of access to all topics that you create in the region they are scoped to. You can create multiple sets of credentials for each of your Topics and Events services. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu. The **Topics and Events** dashboard displays. + +2. Click the **Credentials** tab. + +3. Click **Generate credentials**. A pop-up displays: + + + +4. Choose a region that these credentials should be scoped to. + +5. Enter a name for these credentials. + +6. Select the required permissions for the credentials. You must choose at least one of **Write**, **Read** and **Manage**. You are free to select any combination of these permissions. + +7. Click **Generate credentials**. + + The credentials are created. The access key and secret key are displayed, and you are invited to copy them. + + + This is your only chance to view and save the secret key. Make sure that you copy it and save it somewhere securely. + + +8. Copy and save the credentials, before closing the window. + + You are returned to the **Credentials** tab. The name of your newly-generated credentials, along with the access key and access level are displayed. diff --git a/pages/topics-and-events/how-to/create-manage-subscriptions.mdx b/pages/topics-and-events/how-to/create-manage-subscriptions.mdx new file mode 100644 index 0000000000..80c0290d82 --- /dev/null +++ b/pages/topics-and-events/how-to/create-manage-subscriptions.mdx @@ -0,0 +1,115 @@ +--- +meta: + title: How to create and manage Topics and Events subscriptions + description: Learn to create and manage Scaleway Topics and Events subscriptions. This guide ensures effective message delivery and streamlined communication. +content: + h1: How to create and manage Topics and Events subscriptions + paragraph: Learn to create and manage Scaleway Topics and Events subscriptions. This guide ensures effective message delivery and streamlined communication. +tags: messaging queuing subscriptions sns topics +categories: + - serverless +dates: + validation: 2024-04-10 + posted: 2024-02-06 +--- + +This page shows how to create and manage [subscriptions](/topics-and-events/concepts/#subscription) with Scaleway Topics and Events (formerly part of the Messaging and Queuing product). When you create a subscription to a [topic](/topics-and-events/concepts/#topic), you are effectively signing up an endpoint to receive all messages published to that topic. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization +- An existing [topic](/topics-and-events/how-to/create-manage-topics/) + +## How to create a subscription + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu. + +2. Use the dropdown menu to select the [region](/topics-and-events/concepts/#region) of the topic you want to create a subscription for. + +3. Click the name of the topic you want to create a subscription for. + +4. Click **Create Subscription**. The subscription creation wizard displays. + + +5. Verify the parameters of the topic that you are creating a subscription for (name, and type). + +6. 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 Topics and Events, 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](/topics-and-events/how-to/create-manage-subscriptions/#how-to-confirm-an-http-or-https-subscription). + +
+ +
+ Select **HTTPS** to create a subscription for a service or web server that can receive `HTTP POST` requests from Topics and Events, 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](/topics-and-events/how-to/create-manage-subscriptions/#how-to-confirm-an-http-or-https-subscription). +
+ +
+ 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](/organizations-and-projects/concepts/#project) and [region](/topics-and-events/concepts/#region) as the 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](/serverless-functions/concepts/#privacy-policy) can subscribe to a topic. +
+ +
+ Choose **Queues** to create a subscription for a Scaleway queue that you have created. + + You are prompted to select the **queue** to subscribe. Only queues in the same [Project](/organizations-and-projects/concepts/#project) and [region](/topics-and-events/concepts/#region) as the topic can be selected. +
+
+ +7. 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 / Containers or Queues 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: + +1. Access the subscriptions listing page (from the console side menu, **Serverless** > **Topics and Events** > **Topics**, click the topic containing the subscription). + +2. Click the icon next to the subscription you wish to confirm, then select **Confirm subscription** from the menu. A pop-up displays: + + + +3. Retrieve the confirmation message that Scaleway Topics and Events sent to your endpoint (delivered as an `HTTP POST` request), and extract the `SubscribeURL` from the message payload. + +4. 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. + +5. Click **Confirm subscription**. + + The subscription's 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. + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu. + +2. Use the drop-down menu to select the [region](/topics-and-events/concepts/#region) containing the subscription you want to delete. + +3. Click the topic containing the subscription you want to delete. + +4. Click the **Subscriptions** tab. The list of subscriptions to this topic displays. + +5. 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 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. + +6. Type **DELETE** and click **Delete subscription**. diff --git a/pages/topics-and-events/how-to/create-manage-topics.mdx b/pages/topics-and-events/how-to/create-manage-topics.mdx new file mode 100644 index 0000000000..30cca7bab6 --- /dev/null +++ b/pages/topics-and-events/how-to/create-manage-topics.mdx @@ -0,0 +1,61 @@ +--- +meta: + title: How to create and manage Topics and Events topics + description: Discover how to create and manage topics with Scaleway Topics and Events. Enhance your messaging setup with this comprehensive, easy-to-follow guide. +content: + h1: How to create and manage Topics and Events topics + paragraph: Discover how to create and manage topics with Scaleway Topics and Events. Enhance your messaging setup with this comprehensive, easy-to-follow guide. +tags: messaging queuing topics sns +categories: + - serverless +dates: + validation: 2025-04-10 + posted: 2023-12-27 +--- + +This page shows how to create and manage [topics](/topics-and-events/concepts/#topic) with Scaleway Topics and Events. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization + +## How to create a topic + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu. + +2. Click **Create topic**. The topic creation wizard displays. + + + +3. Choose a region in which to create your topic. + +4. Enter a **name** for your topic. The name must contain no more than 80 characters, and consist only of alphanumeric characters, hyphens, and underscores. Alternatively, you can go with the auto-generated name suggested for you. + +5. Choose a **topic type**. The following topic types are available: + - **Standard**: Ensures at-least-once message delivery, where the order of messages is not preserved. Supports Serverless Functions, Serverless Containers and HTTP/S subscriptions. + - **FIFO**: Provides first-in-first-out delivery, where the order of messages is preserved without duplication. Supports Scaleway Queues subscriptions. [Content-based deduplication](/topics-and-events/concepts/#content-based-deduplication) is only available for FIFO topics. + +6. Click **Create topic** to finish. + +You are returned to the **Topics** tab, where your newly-created topic now displays. The topic's URL is also displayed here, for use in your API/CLI operations. + + +Remember that you need to [create credentials](/topics-and-events/how-to/create-credentials/) in order to access your Topics and Events service and its topics from an API or CLI. Sending messages to topics requires that credentials have the `can_publish` permission, while receiving messages from topics requires the `can_receive` permission. You can create separate credentials if you need to isolate these two roles in your application. + + +## How to delete a topic + +When you no longer want a topic, you can delete it. This action is irreversible and deletes the topic along with all its associated subscriptions. + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu. + +2. Use the drop-down menu to select the [region](/topics-and-events/concepts/#region) containing the topic you want to delete. + +3. Either: + - Click the topic you wish to delete, and navigate to its **Settings** page. Click the **Delete topic** button in the bottom right corner, or + - Click the icon next to the topic 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 topic and all of its associated subscriptions. + +4. Type **DELETE** and click **Delete topic**. \ No newline at end of file diff --git a/pages/topics-and-events/how-to/index.mdx b/pages/topics-and-events/how-to/index.mdx new file mode 100644 index 0000000000..68efa2c53a --- /dev/null +++ b/pages/topics-and-events/how-to/index.mdx @@ -0,0 +1,8 @@ +--- +meta: + title: Topics and Events - How Tos + description: Topics and Events How Tos +content: + h1: Topics and Events - How Tos + paragraph: Topics and Events How Tos +--- diff --git a/pages/topics-and-events/how-to/manage-credentials.mdx b/pages/topics-and-events/how-to/manage-credentials.mdx new file mode 100644 index 0000000000..fe2c64412e --- /dev/null +++ b/pages/topics-and-events/how-to/manage-credentials.mdx @@ -0,0 +1,58 @@ +--- +meta: + title: How to manage credentials for Topics and Events + description: Master managing credentials for Scaleway Topics and Events. Follow this guide to securely update, rotate, and control access to your messaging services. +content: + h1: How to manage credentials for Topics and Events + paragraph: Master managing credentials for Scaleway Topics and Events. Follow this guide to securely update, rotate, and control access to your messaging services. +dates: + validation: 2025-04-10 + posted: 2022-08-11 +tags: manage credentials messaging queuing permissions update revoke +categories: + - serverless +--- + +Credentials give their bearer (e.g. services and platforms) access to your service. + +This page shows how to manage [credentials](/topics-and-events/concepts/#credentials) for Scaleway Topics and Events. Credentials can be updated to change their permissions, or revoked. Once credentials are revoked, any user trying to use the credentials to connect to the service will be denied. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization +- Valid [credentials](/topics-and-events/how-to/create-credentials/) + +## How to update credentials + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu. + +2. Click the **Credentials** tab. + +3. Use the drop-down menu to select the [region](/topics-and-events/concepts/#region) containing the credentials you want to update. + +4. Click the button next to the credentials you want to update, and select **Update credentials**. + +5. Make the required updates to your credentials. You can modify the name, and the permissions. + +6. Click **Update credentials**. + + The credentials are updated and you are returned to the product's **Credentials** listing. + +## How to revoke credentials + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu/ + +2. Click the **Credentials** tab. + +3. Use the drop-down menu to select the [region](/topics-and-events/concepts/#region) containing the credentials you want to revoke. + +4. Click the button next to the credentials you want to revoke and select **Revoke**. + + A pop-up displays, warning you that this action is irreversible and the key will no longer be able to access your service. + +5. Click **Revoke credentials**. + + The credentials are revoked and you are returned to the product's **Credentials** listing. + + diff --git a/pages/topics-and-events/how-to/monitor-topics-cockpit.mdx b/pages/topics-and-events/how-to/monitor-topics-cockpit.mdx new file mode 100644 index 0000000000..fa585c3d2b --- /dev/null +++ b/pages/topics-and-events/how-to/monitor-topics-cockpit.mdx @@ -0,0 +1,41 @@ +--- +meta: + title: How to monitor Topics and Events with Scaleway Cockpit + description: Monitor Topics and Events services with Scaleway Cockpit. This guide helps you track performance to manage your messaging services efficiently. +content: + h1: How to monitor Topics and Events with Scaleway Cockpit + paragraph: Monitor Topics and Events services with Scaleway Cockpit. This guide helps you track performance to manage your messaging services efficiently. +categories: + - serverless +dates: + validation: 2025-04-10 + posted: 2023-09-07 +--- + +You can view metrics for Topics and Events via [Scaleway Cockpit](/cockpit/quickstart/). This allows you to monitor your topics and messages at a glance. There are two steps to complete to view your metrics for the first time with Cockpit: + +1. Generate your Grafana credentials +2. Access the product's metrics dashboard + +These steps are described below. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization + +## How to generate Grafana credentials + +To view your metrics with Cockpit, you will use a Grafana dashboard which is accessible from the Scaleway console. First, you must create a user and their associated credentials (a username and password) for Grafana. This can be done directly from the Scaleway console, [by following this procedure](/cockpit/how-to/retrieve-grafana-credentials/). + +## How to access your Topics and Events dashboard and view your metrics + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu. + +2. Click the **Metrics** tab. + +3. Click **Open Grafana metrics dashboard**. + +4. Enter your Grafana username and password to log in. + + You are directed to the Topics and Events dashboard, where you can view all your metrics. \ No newline at end of file diff --git a/pages/topics-and-events/index.mdx b/pages/topics-and-events/index.mdx new file mode 100644 index 0000000000..1b7abebfd6 --- /dev/null +++ b/pages/topics-and-events/index.mdx @@ -0,0 +1,73 @@ +--- +meta: + title: Topics and Events Documentation + description: Explore Scaleway Topics and Events. Simplify your microservice workflows with scalable, reliable, and cost-effective message handling solutions. +--- + + + +## Getting Started + + + + + + + + + +## Tutorials + + + + + + + + +## Changelog + + \ No newline at end of file diff --git a/pages/topics-and-events/quickstart.mdx b/pages/topics-and-events/quickstart.mdx new file mode 100644 index 0000000000..f728b64530 --- /dev/null +++ b/pages/topics-and-events/quickstart.mdx @@ -0,0 +1,147 @@ +--- +meta: + title: Topics and Events - Quickstart + description: Get started with Scaleway Topics and Events. This quickstart guide helps you easily set up and manage scalable messaging solutions in minutes. +content: + h1: Topics and Events - Quickstart + paragraph: Get started with Scaleway Topics and Events. This quickstart guide helps you easily set up and manage scalable messaging solutions in minutes. +dates: + validation: 2025-04-10 + posted: 2025-04-10 +tags: messaging queuing message-broker topics messages subscriptions events +categories: + - serverless +--- + +Scaleway Topics and Events is a message broker tool that allows you to transfer messages between different microservices and platforms. This enables them to "talk" to each other effectively even if they are not otherwise compatible. Topics and Events enable and simplify microservices application development and allows you to build highly scalable, reliable, distributed applications. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization + +## How to create Topics and Events credentials + +Credentials for Topics and Events are granular: you can define the level of access that they should give. Credentials give the specified level of access to all topics that you create in the region they are scoped to. + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu. The **Topics and Events** dashboard displays. + +2. Click the **Credentials** tab. + +3. Click **Generate credentials**. A pop-up displays: + + + +4. Choose a region that these credentials should be scoped to. + +5. Enter a name for these credentials. + +6. Select the required permissions for the credentials. You must choose at least one of **Write**, **Read** and **Manage**. You are free to select any combination of these permissions. + +7. Click **Generate credentials**. + + The credentials are created. The access key and secret key are displayed, and you are invited to copy them. + + + This is your only chance to view and save the secret key. Make sure that you copy it and save it somewhere securely. + + +8. Copy and save the credentials, before closing the window. + + You are returned to the **Credentials** tab. The name of your newly-generated credentials, along with the access key and access level are displayed. + +## How to create topics + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu. + +2. Click **Create topic**. The topic creation wizard displays. + + + +3. Choose a region in which to create your topic. + +4. Enter a **name** for your topic. The name must contain no more than 80 characters, and consist only of alphanumeric characters, hyphens, and underscores. Alternatively, you can go with the auto-generated name suggested for you. + +5. Choose a **topic type**. The following topic types are available: + - **Standard**: Ensures at-least-once message delivery, where the order of messages is not preserved. Supports Serverless Functions, Serverless Containers and HTTP/S subscriptions. + - **FIFO**: Provides first-in-first-out delivery, where the order of messages is preserved without duplication. Supports Scaleway Queues subscriptions. [Content-based deduplication](/topics-and-events/concepts/#content-based-deduplication) is only available for FIFO topics. + +6. Click **Create topic** to finish. + +You are returned to the **Topics** tab, where your newly-created topic now displays. The topic's URL is also displayed here, for use in your API/CLI operations. + +## How to create a subscription + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu. + +2. Use the dropdown menu to select the [region](/topics-and-events/concepts/#region) of the topic you want to create a subscription for. + +3. Click the name of the topic you want to create a subscription for. + +4. Click **Create Subscription**. The subscription creation wizard displays. + + +5. Verify the parameters of the topic that you are creating a subscription for (name and type). + +6. 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 Topics and Events, 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](/topics-and-events/how-to/create-manage-subscriptions/#how-to-confirm-an-http-or-https-subscription). + +
+ +
+ Select **HTTPS** to create a subscription for a service or web server that can receive `HTTP POST` requests from Topics and Events, 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](/topics-and-events/how-to/create-manage-subscriptions/#how-to-confirm-an-http-or-https-subscription). +
+ +
+ 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](/organizations-and-projects/concepts/#project) and [region](/topics-and-events/concepts/#region) as the 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](/serverless-functions/concepts/#privacy-policy) can subscribe to a topic. +
+ +
+ + Choose **Queues** to create a subscription for a Scaleway queue that you have created. + + You are prompted to select the **queue** to subscribe. Only queues in the same [Project](/organizations-and-projects/concepts/#project) and [region](/topics-and-events/concepts/#region) as the topic can be selected. +
+
+ +7. Click **Create subscription** to finish. + + The subscription is created. If you created an HTTP or HTTPS subscription, you will now need to [confirm it](/topics-and-events/how-to/create-manage-subscriptions/#how-to-confirm-an-http-or-https-subscription). + +## How to publish messages + +All further actions related to publishing messages to topics can be done via a supported CLI or SDK. See our documentation on the [SNS CLI and SDKs](/topics-and-events/reference-content/sns-overview#further-actions)for more information. + +## How to delete a topic + +When you no longer want a topic, you can delete it. This action is irreversible and deletes the topic along with all its associated subscriptions. + +1. Click **Topics and Events** in the **Serverless** section of the Scaleway console side menu. + +2. Use the drop-down menu to select the [region](/topics-and-events/concepts/#region) containing the topic you want to delete. + +3. Either: + - Click the topic you wish to delete, and navigate to its **Settings** page. Click the **Delete topic** button in the bottom right corner, or + - Click the icon next to the topic 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 topic and all of its associated subscriptions. + +4. Type **DELETE** and click **Delete topic**. diff --git a/pages/topics-and-events/reference-content/index.mdx b/pages/topics-and-events/reference-content/index.mdx new file mode 100644 index 0000000000..fcfcdbe04d --- /dev/null +++ b/pages/topics-and-events/reference-content/index.mdx @@ -0,0 +1,8 @@ +--- +meta: + title: Topics and Events - Additional content + description: Topics and Events additional content +content: + h1: Topics and Events - Additional content + paragraph: Topics and Events additional content +--- diff --git a/pages/topics-and-events/reference-content/limitations.mdx b/pages/topics-and-events/reference-content/limitations.mdx new file mode 100644 index 0000000000..c5f693efc0 --- /dev/null +++ b/pages/topics-and-events/reference-content/limitations.mdx @@ -0,0 +1,22 @@ +--- +meta: + title: Topics and Events Limitations + description: Learn about the current limitations of Scaleway Topics and Events +content: + h1: Limitations + paragraph: Learn about the current limitations of Scaleway Topics and Events +tags: messaging limitations +dates: + validation: 2025-04-10 + posted: 2023-01-04 +categories: + - serverless +--- + +## Usage limits + +For the usage limits that apply when using Scaleway Topics and Events, see the dedicated sections on our [Organization quotas](/organizations-and-projects/additional-content/organization-quotas/) page. Limits (quotas) apply to, for example, the maximum number of topics, and consumers/subscribers, as well as to message retention duration and storage. + +## VPC + +Topics and Events are not currently compatible with [Scaleway VPC](/vpc/quickstart/). diff --git a/pages/topics-and-events/reference-content/topics-and-events-overview.mdx b/pages/topics-and-events/reference-content/topics-and-events-overview.mdx new file mode 100644 index 0000000000..8a5bf65026 --- /dev/null +++ b/pages/topics-and-events/reference-content/topics-and-events-overview.mdx @@ -0,0 +1,62 @@ +--- +meta: + title: Topics and Events Overview + description: Learn about the Scaleway Topics and Events messaging system +content: + h1: Topics and Events Overview + paragraph: Learn about the Scaleway Topics and Events messaging system +tags: messaging sns aws queuing publish-subscribe message-queue topic notification simple notification service +categories: + - serverless +dates: + validation: 2025-04-10 + posted: 2023-01-04 +--- + +## What is Scaleway Topics and Events? + +Scaleway Topics and Events is a managed messaging service that facilitates the sending of notifications or messages to a large number of subscribers, including email addresses, webhooks, and more. Topics and Events leverages the SNS protocol. + +## What is SNS? + +SNS is a managed messaging service developed by AWS and leveraged by Scaleway Topics and Events. + +SNS (Simple Notification Service) was released in 2010. It enables users to interconnect their applications and systems using a [publish/subscribe](/topics-and-events/concepts#publishsubscribe) pattern. Many publishers can send messages to [topics](/topics-and-events/concepts#topic), while consumers, e.g. applications, can subscribe to topics to receive all (or a subset) of messages sent to this topic. Scaleway Topics and Events makes it easy to migrate your SNS-connected applications by providing a dedicated protocol gateway. + + + Some SNS features are not yet available with Scaleway Topics and Events. Supported subscribers are currently limited to: + - HTTP/S clients + - [Serverless Functions](https://www.scaleway.com/en/serverless-functions/) + - Scaleway queues in the same [Project](/organizations-and-projects/concepts/#project) + + Refer to the [developers documentation](https://www.scaleway.com/en/developers/api/messaging-and-queuing/sns-api/) for more information. + + +## Topics and Events credentials + +You must [create credentials](/topics-and-events/how-to/create-credentials/) that give your applications permission to connect to the Scaleway Topics and Events service. + +Credentials are scoped to your Topics and Events service at [Project](/organizations-and-projects/concepts/#project)-level. You can choose to give each set of credentials the required level of permissions: + + - **Read**: receive messages from queues and topics. + - **Write**: send messages to queues and publish in topics. + - **Manage**: create or edit resources (such as queues and topics). + +## Topics and subscriptions + +You can [create topics](/topics-and-events/how-to/create-manage-topics/) and [subscriptions](/topics-and-events/how-to/create-manage-subscriptions/) via the Scaleway console. + +## Further actions + +All further actions such as sending messages etc. can be done using the AWS CLI or AWS SDKs. Check out our documentation to help you get started with the [AWS CLI](/topics-and-events/api-cli/connect-aws-cli/) or [AWS SDKs](/topics-and-events/api-cli/python-node-topics-events/). + +## Topics and Events Resources + +The following resources may be helpful: + + - [Official SNS Documentation](https://docs.aws.amazon.com/sns/latest/dg/welcome.html) + - Further information on supported API features: + - [SNS](/topics-and-events/reference-content/sns-support/) + - [Creating a simulated CPU monitor notification system with Scaleway Topics and Events](/tutorials/sns-instances-notification-system/) + - [Official AWS CLI Documentation](https://aws.amazon.com/cli/) + - [Official AWS SDK Documentation](https://aws.amazon.com/developer/tools/) \ No newline at end of file diff --git a/pages/topics-and-events/reference-content/topics-and-events-support.mdx b/pages/topics-and-events/reference-content/topics-and-events-support.mdx new file mode 100644 index 0000000000..5847a314a9 --- /dev/null +++ b/pages/topics-and-events/reference-content/topics-and-events-support.mdx @@ -0,0 +1,279 @@ +--- +meta: + title: Topics and Events - Supported Actions + description: Discover which SNS AWS API actions are supported by Scaleway Topics and Events +content: + h1: Topics and Events - Supported Actions + paragraph: Discover which SNS AWS API actions are supported by Scaleway Topics and Events +tags: messaging queuing supported supports sns aws api actions +categories: + - serverless +dates: + validation: 2025-04-10 + posted: 2023-01-04 +--- + +This page lists all actions described in the AWS SNS documentation, and states whether they are supported by Scaleway Topics and Events. + +- **Y** means the parameter is fully supported +- **N** means the parameter is not supported +- **P** means the parameter is partially supported (see associated comments for more details) + +## CreateTopic + +CreateTopic requires the `CanManage` permission. + +### CreateTopic Request + +| Parameters | Support | Comments | +|:----------------------|:---------:|:--------------------------------------------------------------------------------------------------| +| Attributes (map) | **P** | See supported attributes in the [SNS Topic Attributes](#sns-api-support-topic-attributes) section | +| Name | **Y** | | +| Tags.member.N (array) | **N** | | + +### CreateTopic Response + +| Elements | Support | Comments | +|:-----------|:---------:|:-----------| +| TopicArn | **Y** | | + +## DeleteTopic + +DeleteTopic requires the `CanManage` permission. + +### DeleteTopic Request + +| Parameters | Support | Comments | +|:-------------|:---------:|:-----------| +| TopicArn | **Y** | | + +## ListTopics + +ListTopics requires the `CanPublish`, `CanReceive` or `CanManage` permission. + +### ListTopics Request + +| Parameters | Support | Comments | +|:-------------|:---------:|:-----------| +| NextToken | **N** | | + +### ListTopics Response + +| Elements | Support | Comments | +|:------------------------|:---------:|:-----------| +| NextToken | **N** | | +| Topics.member.N (array) | **Y** | | + +## ListSubscriptions + +ListSubscriptions requires the `CanReceive` or `CanManage` permission. + +### ListSubscriptions Request + +| Parameters | Support | Comments | +|:-------------|:---------:|:-----------| +| NextToken | **N** | | + +### ListSubscriptions Response + +| Elements | Support | Comments | +|:-------------------------------|:---------:|:-----------| +| NextToken | **N** | | +| Subscriptions.member.N (array) | **Y** | | + +## ListSubscriptionsByTopic + +ListSubscriptionsByTopic requires the `CanReceive` or `CanManage` permission. + +### ListSubscriptionsByTopic Request + +| Parameters | Support | Comments | +|:-------------|:---------:|:-----------| +| NextToken | **N** | | +| TopicArn | **Y** | | + +### ListSubscriptionsByTopic Response + +| Elements | Support | Comments | +|:-------------------------------|:---------:|:-----------| +| NextToken | **N** | | +| Subscriptions.member.N (array) | **Y** | | + +## Publish + +Publish requires the `CanPublish` permission. + +### Publish Request + +| Parameters | Support | Comments | +|:-----------------------|:---------:|:-----------| +| Message | **Y** | | +| MessageAttributes | **Y** | | +| MessageDeduplicationId | **Y** | | +| MessageGroupId | **N** | | +| MessageStructure | **N** | | +| PhoneNumber | **N** | | +| Subject | **Y** | | +| TargetArn | **N** | | +| TopicArn | **Y** | | + +### Publish Response + +| Elements | Support | Comments | +|:---------------|:---------:|:-----------| +| MessageId | **Y** | | +| SequenceNumber | **N** | | + +## PublishBatch + +PublishBatch requires the `CanPublish` permission. + +### PublishBatch Request + +| Parameters | Support | Comments | +|:--------------------------------------------|:---------:|:-------------------------------------------------------------------------------------------------| +| PublishBatchRequestEntries.member.N (array) | **P** | As with the Publish action, the MessageGroupId and MessageStructure parameters are not supported | +| TopicArn | **Y** | | + +### PublishBatch Response + +| Elements | Support | Comments | +|:----------------------------|:---------:|:-----------| +| Failed.member.N (array) | **Y** | | +| Successful.member.N (array) | **Y** | | + +## Subscribe + +Subscribe requires the `CanReceive` permission. + +### Subscribe Request + +| Parameters | Support | Comments | +|:----------------------|:---------:|:----------------------------------------------------------------------------------------------------------------| +| Attributes (map) | **P** | See supported attributes in the [SNS Subscription Attributes](#sns-api-support-subscription-attributes) section | +| Endpoint | **Y** | Note that for lambda, the endpoint must be the Scaleway Serverless Function public URL | +| Protocol | **P** | Only http, sqs and lambda protocols are supported | +| ReturnSubscriptionArn | **Y** | | +| TopicArn | **Y** | | + +### Subscribe Response + +| Elements | Support | Comments | +|:----------------|:---------:|:-----------| +| SubscriptionArn | **Y** | | + +## Unsubscribe + +Unsubscribe requires the `CanReceive` or `CanManage` permission. + +### Unsubscribe Request + +| Parameters | Support | Comments | +|:----------------|:---------:|:-----------| +| SubscriptionArn | **Y** | | + +## GetTopicAttributes + +GetTopicAttributes requires the `CanReceive` or `CanManage` permission. + +### GetTopicAttributes Request + +| Parameters | Support | Comments | +|:-------------|:---------:|:-----------| +| TopicArn | **Y** | | + +### GetTopicAttributes Response + +| Elements | Support | Comments | +|:-----------------|:---------:|:--------------------------------------------------------------------------------------------------| +| Attributes (map) | **P** | See supported attributes in the [SNS Topic Attributes](#sns-api-support-topic-attributes) section | + +## SetTopicAttributes + +SetTopicAttributes requires the `CanManage` permission. + +### SetTopicAttributes Request + +| Parameters | Support | Comments | +|:---------------|:---------:|:--------------------------------------------------------------------------------------------------| +| AttributeName | **P** | See supported attributes in the [SNS Topic Attributes](#sns-api-support-topic-attributes) section | +| AttributeValue | **Y** | | +| TopicArn | **Y** | | + +## ConfirmSubscription + +ConfirmSubscription requires the `None` permission. + +### ConfirmSubscription Request + +| Parameters | Support | Comments | +|:--------------------------|:---------:|:-----------| +| AuthenticateOnUnsubscribe | **N** | | +| Token | **Y** | | +| TopicArn | **Y** | | + +### ConfirmSubscription Response + +| Elements | Support | Comments | +|:----------------|:---------:|:-----------| +| SubscriptionArn | **Y** | | + +## GetSubscriptionAttributes + +GetSubscriptionAttributes requires the `CanReceive` or `CanManage` permission. + +### GetSubscriptionAttributes Request + +| Parameters | Support | Comments | +|:----------------|:---------:|:-----------| +| SubscriptionArn | **Y** | | + +### GetSubscriptionAttributes Response + +| Elements | Support | Comments | +|:-----------------|:---------:|:----------------------------------------------------------------------------------------------------------------| +| Attributes (map) | **P** | See supported attributes in the [SNS Subscription Attributes](#sns-api-support-subscription-attributes) section | + +## SetSubscriptionAttributes + +SetSubscriptionAttributes requires the `CanReceive` or `CanManage` permission. + +### SetSubscriptionAttributes Request + +| Parameters | Support | Comments | +|:----------------|:---------:|:----------------------------------------------------------------------------------------------------------------| +| AttributeName | **P** | See supported attributes in the [SNS Subscription Attributes](#sns-api-support-subscription-attributes) section | +| AttributeValue | **Y** | | +| SubscriptionArn | **Y** | | + +### SNS API support - Topic attributes + +The Scaleway Topics and Events API (currently named the SNS API) supports the following topic attributes: + +| Attribute Name | Support | Comments | +|:--------------------------|:---------:|:------------------------------------------------------| +| ContentBasedDeduplication | **Y** | | +| DeliveryPolicy | **N** | | +| DisplayName | **N** | | +| EffectiveDeliveryPolicy | **N** | | +| FifoTopic | **Y** | | +| KmsMasterKeyId | **N** | | +| Owner | **Y** | | +| Policy | **N** | | +| SignatureVersion | **N** | Version 1 is always used, version 2 is not supported. | +| SubscriptionsConfirmed | **Y** | | +| SubscriptionsDeleted | **Y** | | +| SubscriptionsPending | **Y** | | +| TopicArn | **Y** | | + +### SNS API support - Subscription attributes + +The Scaleway Topics and Events API (currently named the SNS API) supports the following subscription attributes: + +| Attribute Name | Support | Comments | +|:--------------------|:---------:|:-----------| +| DeliveryPolicy | **N** | | +| FilterPolicy | **N** | | +| RawMessageDelivery | **N** | | +| RedrivePolicy | **N** | | +| SubscriptionRoleArn | **N** | | \ No newline at end of file