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:
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.
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.
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.
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.
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.
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.