AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Subscribes an existing Amazon SQS queue to existing Amazon SNS topics asynchronously.

The policy applied to the SQS queue is similar to this:

    "Version" : "2008-10-17",
    "Statement" : [{
        "Sid" : "topic-subscription-arn:aws:sns:us-west-2:599109622955:myTopic",
        "Effect" : "Allow",
        "Principal" : "*",
        "Action" : ["sqs:SendMessage"],
        "Condition" : {

There might be a small time period immediately after subscribing the SQS queue to the SNS topic and updating the SQS queue's policy, where messages are not able to be delivered to the queue. After a moment, the new queue policy will propagate and the queue will be able to receive messages. This delay only occurs immediately after initially subscribing the queue.


This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginSubscribeQueueToTopics and EndSubscribeQueueToTopics.

Namespace: Amazon.SimpleNotificationService
Assembly: AWSSDK.SimpleNotificationService.dll
Version: 3.x.y.z


public abstract Task<IDictionary<String, String>> SubscribeQueueToTopicsAsync(
         IList<String> topicArns,
         ICoreAmazonSQS sqsClient,
         String sqsQueueUrl
Type: System.Collections.Generic.IList<System.String>

The topics to subscribe to

Type: Amazon.Runtime.SharedInterfaces.ICoreAmazonSQS

The SQS client used to get attributes and set the policy on the SQS queue.

Type: System.String

The queue to add a subscription to.

Return Value
A Task containing the mapping of topic ARNs to subscription ARNs as returned by Amazon SNS wrapped when the queue is successfully subscribed to each topic.

Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms