我試圖建立我的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