监听S3事件,并推送到SNS和SQS

最近在备考AWS架构师认证,发现一道有意思的题目。网上都找不到正解。

题目如下:

A company's operations team has an existing Amazon S3 bucket configured to notify an Amazon SQS queue when new objects are created within the bucket. The development team also wants to receive events when new objects are created. The existing operations team workflow must remain intact.
Which solution would satisfy these requirements?

A. Create another SQS queue. Update the S3 events in the bucket to also update the new queue when a new object is created.
B. Create a new SQS queue that only allows Amazon S3 to access the queue. Update Amazon S3 to update this queue when a new object is created.
C. Create an Amazon SNS topic and SQS queue for the bucket updates. Update the bucket to send events to the new topic. Updates both queues to poll Amazon SNS.
D. Create an Amazon SNS topic and SQS queue for the bucket updates. Update the bucket to send events to the new topic. Add subscriptions for both queues in the topic.

正解是D。

其实光看题目A似乎是一个更简单的问题,但是亲身实践了以后,会发现,

如果在S3中创建两条event,包含相同的触发条件,在创建时会报错:

 

所以两条一样触发条件的event,必须合在一起配置。

一起配置就只能有一个Destination。一个SNS或者一个SQS或者一个Lambda。不能配置两个SQS。如下图:

A与B就肯定不对了。

C的问题在于SNS能主动推送,不需要poll,这是SNS和SQS的主要区别。SQS才需要poll。

所以D才是正解,通过创建一个SNS,作为S3 event通知的Destination。

然后在SNS中配置两个SQS的Subscriptions,一个给operations team,一个给development team。保证了operations team的SQS不被影响。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱知菜

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值