我正在为一个存储桶事件尝试两个SNS主题。目前,我已经以这种方式配置了我的存储桶:
TranscribedBucket:
Type: AWS::S3::Bucket
DeletionPolicy: Retain
Properties:
NotificationConfiguration:
TopicConfigurations:
- Event: s3:ObjectCreated:*
Topic:
Ref: Transformer
Filter:
S3Key:
Rules:
- Name: prefix
Value: "transcribed-"
BucketName: ${self:provider.transcribedBucket}
两个订户lambda正在监听主题Transfomer
,它们实际上是在同一文件夹中的不同文件夹下输出的(例如,subscriberLambda1的folder1 / file1和subscriberLambda2的folder2 / file2)。完成此操作后,每当文件放入该文件夹时,我就会有一个lambda实际上需要消耗一个SNS事件。
由于- Event: s3:ObjectCreated:*
无法复制,因此我实际上无法为同一存储桶再创建一个Topic
。我该如何进行呢?
答案 0 :(得分:1)
您应该能够执行以下操作:
TranscribedBucket:
Type: AWS::S3::Bucket
DeletionPolicy: Retain
Properties:
NotificationConfiguration:
TopicConfigurations:
- Event: s3:ObjectCreated:*
Topic:
Ref: Transformer
Filter:
S3Key:
Rules:
- Name: prefix
Value: "folder1/"
- Event: s3:ObjectCreated:*
Topic:
Ref: Bumblebee
Filter:
S3Key:
Rules:
- Name: prefix
Value: "folder2/"
BucketName: ${self:provider.transcribedBucket}