Tutorial: Subscribing an Amazon SQS Queue to an Amazon SNS Topic
You can subscribe one or more Amazon SQS queues to an Amazon SNS topic from a list of topics available for the selected queue. Amazon SQS manages the subscription and any necessary permissions. When you publish an Amazon SQS message to a topic, Amazon SNS sends the message to any subscribed queues. For more information about Amazon SNS, see What is Amazon Simple Notification Service? in the Amazon Simple Notification Service Developer Guide.
The following example demonstrates subscribing an existing Amazon SQS queue to an existing Amazon SNS topic.
Amazon SNS isn't currently compatible with FIFO queues.
When you subscribe an Amazon SQS queue to an Amazon SNS topic, Amazon SNS uses HTTPS to forward messages to Amazon SQS.
AWS Management Console
Sign in to the AWS Management Console and open the Amazon SQS console at https://console.aws.amazon.com/sqs/.
From the list of queues, choose the queue (or queues) to which you want to subscribe an Amazon SNS topic.
From the Queue Actions drop-down list, select Subscribe Queue to SNS Topic (or Subscribe Queues to SNS Topic).
The Subscribe to a Topic dialog box is displayed.
From the Choose a Topic drop-down list, select an Amazon SNS topic to which you want to subscribe your queue (or queues), select the Topic Region (optional), and then choose Subscribe.
Typing a different Topic ARN is useful when you want to subscribe a queue to an Amazon SNS topic from an AWS account other than the one you used to create your Amazon SQS queue.
This is also useful if the Amazon SNS topic isn't listed in the Choose a Topic drop-down list.
The Topic Subscription Result dialog box is displayed.
Review the list of Amazon SQS queues that are subscribed to the Amazon SNS topic and choose OK.
The queue is subscribed to the topic.
To list your subscriptions, unsubscribe from topics, and delete topics, use the Amazon SNS console. For more information, see Clean Up in the Amazon Simple Notification Service Developer Guide.
To verify the results of the subscription, you can publish to the topic and then view the message that the topic sends to the queue. For more information, see Sending Amazon SNS Messages to Amazon SQS Queues in the Amazon Simple Notification Service Developer Guide.