amazon-web-services - 上传到 S3 后触发 SWF 工作流

标签 amazon-web-services amazon-s3 amazon-swf

我有一个工作流,它在 S3 存储桶中获取一个文件,并根据文件内容进行大量处理和进一步的请求。目前,客户端必须在上传文件后手动触发工作流。这对我来说似乎是一个很常见的用例,那么有什么方法可以在文件上传后立即触发工作流程?

我想在两者之间应该有一个 SNS 通知,但有没有办法将通知直接发送到 SWF,而无需服务使用它们并启动工作流?

最佳答案

更新

AWS 终于推出了New Event Notifications for Amazon S3今天,这确实只是扩展了长期可用的PUT Bucket notification API 附加 event types用于通过 S3 API(例如 PUT、POST 和 COPY)创建对象:

  • s3:ObjectCreated:*
  • s3:ObjectCreated:Put
  • s3:ObjectCreated:Post
  • s3:ObjectCreated:Copy
  • s3:ObjectCreated:CompleteMultipartUpload

初步回答

[...] is there any way to send the notification directly to the SWF, without having a service consuming them and starting the workflow?

不幸的是,没有这样的方法,您确实需要中介服务 - 而 PUT Bucket notification显然也被设计为允许其他类型的事件,Amazon S3不支持 Amazon SNSEnabling RRS Lost Object Notifications 之外的任何内容的通知从今天开始:

This implementation of the PUT operation uses the notification subresource to enable notifications of specified events for a bucket. Currently, the s3:ReducedRedundancyLostObject event is the only event supported for notifications. The s3:ReducedRedundancyLostObject event is triggered when Amazon S3 detects that it has lost all replicas of an object and can no longer service requests for that object. [emphasis mine]

关于amazon-web-services - 上传到 S3 后触发 SWF 工作流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23816892/

相关文章:

linux - 如何在 Amazon Linux AMI 上安装 Caffe 所需的包

java - 为什么在本地模式下运行 Spark 时,我需要使用 DataFrames API 执行读取以通过 AWS 进行身份验证?

amazon-web-services - AWS Cloudformation Elastic Load Balancing 账户 ID

amazon-web-services - Amazon SES - 电子邮件验证通知

sql - AWS DMS。复制实例中的端点连接失败(错误 : 1020912)

Java - 来自 S3 的自动更新

java - 轮询时 AWS SWF 决策者 'java.net.SocketTimeoutException: Read timed out'

java - AWS SWF 在特定条件下重新启动工作流程

java - SWF : Get the result of all the activities in workflow starter program

amazon-web-services - Docker Elastic Beanstalk ELB忽略.ebextesnions