我试图建立我的S3通知我SQS队列的“PUT”对象的创建活动。发布S3桶通知到SQS
我能够通过实现这个使用CLI:
aws --profile QA s3api put-bucket-notification --bucket <BUCKET_NAME> --notification-configuration '{ "QueueConfiguration": { "Id": "<EVENT ID>", "Event": "s3:ObjectCreated:Put", "Queue": "<QUEUE ARN>" } }'
也能做到使用Java一样:
NotificationConfiguration notificationConfiguration = new QueueConfiguration(queueArn, EnumSet.of(S3Event.ObjectCreatedByPut));
BucketNotificationConfiguration bucketNotificationConfiguration = new BucketNotificationConfiguration("DropShipInboundQueueDelivery", notificationConfiguration);
client.setBucketNotificationConfiguration(bucketName, bucketNotificationConfiguration)
然而,当我试图类似的东西使用CloudFormation模板,我不能找到任何方式来触发通知SQS。我看到的唯一可行的方法是记录SNS通知。
我所提到的云的形成文档:
- 我看着AWS::S3::Bucket文档看外语法。我看到NotificationConfiguration,我需要设置
- 然而Notification Configuration只能包含TopicConfigurations同是老构造在JDK的列表之前QueueConfiguration
我试图做这样的事情得到了支持:
"NotificationConfiguration" :{
"QueueConfiguration": {
"Id": "DropshipInboundEventNotification",
"Event": "s3:ObjectCreated:Put",
"Queue": "arn:aws:sqs:*:*:Dropship-Inbound-qa"
}
},
但这种预期抛出一个错误:从亚马逊“遇到不支持的属性QueueConfiguration”。
我想知道是否有人已经能够做到这一点使用CloudFormation模板,因为这就是我如何保持所有其他AWS资源,不希望为这个特殊的做特别的特征。
任何帮助表示赞赏。
我还没有尝试过这个功能我自己,但我发现CloudFormation一般要滞后几个月的订单上的API后面。如果有一个变化的一段时间回来,如何这工作的,很可能只是还没有迁移到CF ......了吗? – DanielM 2015-09-09 16:13:22