AWS Certified Developer - Associate Exam: Integration of Amazon SNS with Amazon SQS

Enable Amazon SNS Topic to Send Messages to Amazon SQS

Prev Question Next Question

Question

A Start-up firm plans to implement a distributed stock trading application that requires time-critical messages to be sent to premium subscribers.

This developer team needs your guidance to integrate Amazon SNS with Amazon SQS.

Which of the following is NOT required to be done to enable Amazon SNS topic to send messages to Amazon SQS?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

Correct Answer - B.

To enable an Amazon SNS topic to send messages to an Amazon SQS queue, follow these steps.

· Get the Amazon Resource Name (ARN) of the queue & SNS topic.

· Give SQS: SendMessage permission to the Amazon SNS topic.

· Subscribe the queue to the Amazon SNS topic.

· Give IAM users, or AWS accounts the appropriate permissions.

Option A, C, D & E are incorrect as these are required steps for sending messages to the Amazon SQS queue from Amazon SNS.

For more information on Fanout with Amazon SNS, refer to the following URL-

https://docs.aws.amazon.com/sns/latest/dg/sns-sqs-as-subscriber.html

To integrate Amazon SNS with Amazon SQS, we need to follow these steps:

  1. Create an Amazon SNS Topic: We need to create an Amazon SNS topic to publish messages. This topic will act as a channel to send messages to Amazon SQS.

  2. Create an Amazon SQS Queue: We need to create an Amazon SQS queue to receive messages. This queue will act as a receiver of messages sent by Amazon SNS.

  3. Subscribe the Amazon SQS Queue to the Amazon SNS Topic: We need to subscribe the Amazon SQS queue to the Amazon SNS topic. This will allow the Amazon SNS topic to send messages to the Amazon SQS queue.

  4. Give sns:Publish Permission to Amazon SNS Topic: We need to give sns:Publish permission to the Amazon SNS topic so that it can publish messages to the Amazon SQS queue.

  5. Give sqs:SendMessage Permission to Amazon SNS Topic: We need to give sqs:SendMessage permission to the Amazon SNS topic so that it can send messages to the Amazon SQS queue.

  6. Allow IAM Users to Publish to SNS Topics and Read Messages from the Queue: We need to allow IAM users to publish messages to the Amazon SNS topic and read messages from the Amazon SQS queue.

Answer (A) is required to enable Amazon SNS topic to send messages to Amazon SQS. We need to get the ARN of the queue to send a message and the topic to be subscribed to this queue.

Answer (B) is required to enable Amazon SNS topic to send messages to Amazon SQS. We need to give sns:Publish permission to the Amazon SNS topic so that it can publish messages to the Amazon SQS queue.

Answer (C) is required to enable Amazon SNS topic to send messages to Amazon SQS. We need to give sqs:SendMessage permission to the Amazon SNS topic so that it can send messages to the Amazon SQS queue.

Answer (D) is required to enable Amazon SNS topic to send messages to Amazon SQS. We need to subscribe the Amazon SQS queue to the Amazon SNS topic so that it can receive messages from the Amazon SNS topic.

Answer (E) is not required to enable Amazon SNS topic to send messages to Amazon SQS. It is an additional step to allow IAM users to publish messages to the Amazon SNS topic and read messages from the Amazon SQS queue.

Therefore, the answer is (E) - Allow IAM users to publish to SNS topics and read messages from the queue.