问题描述
我们曾经在我们的函数中使用参数 existing: true
将事件通知附加到我们的 S3 存储桶。
但是现在当我尝试使用此参数部署新堆栈时,出现以下错误:
An error occurred: EventDashs3CustomS31 - Received response status [Failed] from custom resource. Message returned: Unable to validate the following destination configurations See details in CloudWatch Log: 2021/07/01/[$LATEST]f75aa563de5a4bfba7648d2369650888 (RequestId: 6fd0e4db-f0b2-4b4f-ba91-d76eeb1fb888).
无服务器配置:
environment:
BUCKET_UPLOAD_CSV: my_upload_bucket
iamRoleStatements:
- Effect: Allow
Action:
- s3:ListBucket
- s3:PutObject
- s3:Getobject
- s3:DeleteObject
- "s3:GetBucketNotification"
- "s3:PutBucketNotification"
Resource: "arn:aws:s3:::${self:provider.environment.BUCKET_UPLOAD_CSV}/*"
functions:
event-s3:
runtime: nodejs14.x
handler: index.handler
tags: ${self:custom.tags}
timeout: 900
memorySize: 128
events:
- s3:
bucket: ${self:provider.environment.BUCKET_UPLOAD_CSV}
event: s3:ObjectCreated:*
existing: true
rules:
- prefix: public/upload
有什么想法吗?我在网上阅读了一些有关此错误的帖子,并尝试了以下操作:
- 首先部署 lambda,然后附加通知事件。
- 将 lambda:InvokeFunction 作为对存储桶的 IAM 权限。
- 尝试使用 serverless-plugin-existing-s3
但是,到目前为止还没有成功。
我目前使用的是最新版本的无服务器 (2.50)
问候
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)