gpt4 book ai didi

amazon-web-services - 您能否将 S3 存储桶触发器从以前的函数移至无服务器框架中的新函数?

转载 作者:行者123 更新时间:2023-12-03 07:38:43 25 4
gpt4 key购买 nike

我有一个 Lambda,它附加了一个触发的存储桶。我正在创建第二个函数,并希望将此触发器添加到第二个函数并将其从第一个函数中删除

以前:

functions:
func1:
handler: src/func1/func1.handler
events:
- s3:
bucket: ${self:custom.bucketname}
event: s3:ObjectCreated:*
existing: true
- sqs:
arn: !GetAtt queue.Arn
batchSize: 1

现在:

functions:
func1:
handler: src/func1/func1.handler
events: []

func2:
handler: src/func2/func2.handler
events:
- s3:
bucket: ${self:custom.bucketname}
event: s3:ObjectCreated:*
existing: true
- sqs:
arn: !GetAtt queue.Arn
batchSize: 1

但是每当我尝试部署时,我都会得到:

Received response status [FAILED] from custom resource. Message returned: Configurations overlap. Configurations on the same bucket cannot share a common event type. See details in CloudWatch Log: ...

当我重新部署时,它似乎并没有首先从第一个函数中删除触发器。

最佳答案

因此,Serverless 不够智能,无法知道您已经移动了它,您需要首先拆除原始的,然后启动新的。

关于amazon-web-services - 您能否将 S3 存储桶触发器从以前的函数移至无服务器框架中的新函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75439910/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com