amazon-web-services - 在 s3 事件上使用“existing: true”会引发“无法验证以下目标配置”
问题描述
我们曾经在我们的函数中使用参数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)
问候
解决方案
推荐阅读
- laravel - 如何解决违反完整性约束的问题:where 子句中的 1052 列“agent_id”不明确
- javascript - 第一次验证后如何在节点js中过期recaptcha
- php - 如何在 Azure Lunix 应用服务提供的 PHP 代码中使用 Mysql 连接字符串
- python - 在 Google Colab 上将视频上传到 Youtube
- pandas - Pandas,为每个用户获取第一、第二和第三首选作者
- sql-server - PL SQL“数组类型”到TSQL的翻译
- primefaces - 从命令按钮调用 Primefaces 对话框时不起作用
- powerapps - 如何在两个表之间进行连接并以相同的方式进行过滤?
- python - 迭代订单以捕获和组织时间值
- c++ - 是否可以将函数调用堆栈放在堆上?