Soru

Zorluk: KolayMessage-Based Integration using Amazon SQS and SNS

A developer is implementing a messaging solution for a retail checkout application. When a purchase is completed, an event must be sent to an Amazon SNS topic and fanned out to two Amazon SQS queues: one for shipping logistics and one for customer notifications.

Which of the following actions must the developer take to ensure that messages published to the SNS topic are successfully delivered to both SQS queues? (Select TWO.)

  1. Subscribe both SQS queues to the SNS topic.Cevap
  2. Configure the SQS queue access policy for both queues to grant the 'sqs:SendMessage' permission to the SNS topic principal.Cevap
  3. C
    Configure the SQS queue visibility timeout to be shorter than the SNS message retention period to accelerate message routing.
  4. D
    Add an IAM trust policy to the SNS topic that allows the SQS queues to assume the SNS topic's IAM service role.
  5. E
    Initialize the SNS client inside the application by hardcoding an IAM user's secret access key that has full SQS permissions.

Cevap

To successfully fan out messages from an Amazon SNS topic to Amazon SQS queues, the developer must subscribe the SQS queues to the SNS topic and grant the SNS topic permission to send messages by updating the SQS queue access policies.
The correct options are to subscribe both SQS queues to the SNS topic and to configure the SQS queue access policies to grant the SNS topic principal the 'sqs:SendMessage' permission. This allows the SNS topic to successfully push messages to the SQS queues.

Adım Adım Çözüm

1
Set up subscription.
Subscribed both SQS queues to the target SNS topic.
This establishes the relationship so that any message published to the SNS topic is forwarded to the queues.
2
Authorize SNS to write to SQS.
Updated the resource-based access policies of the SQS queues to allow the SNS topic to invoke 'sqs:SendMessage'.
By default, SQS queues reject message deliveries from external services unless a resource-based policy explicitly allows the service principal of the SNS topic to write to them.

Anahtar Kavram

Amazon SNS-to-SQS fanout requires subscribing the queues to the topic and configuring the SQS queue access policies to allow the SNS topic to write to the queues.
Bu soruyu puanla