amazon-web-services - 为什么 S3 不触发 Lambda 函数?
问题描述
当我将 .png 图像放入同一区域的组合文件存储桶时,应该触发一个事件,但是当我这样做时没有触发任何事件。我的代码有什么错误/遗漏吗?
请帮忙!我在这上面花了几个小时!非常感激!
处理程序.py:
import boto3
s3 = boto3.client('s3')
def combine_files(event, context):
print('start')
print(event)
无服务器.yml:
service: combine-files
provider:
name: aws
runtime: python2.7
region: us-west-2
profile: serverless-admin
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:*"
Resource: "*"
custom:
bucket: combine-files
pythonRequirements:
dockerizePip: true
functions:
combine_files:
handler: handler.combine_files
events:
- s3:
bucket: ${self:custom.bucket}
event: s3:ObjectCreated:*
rules:
- suffix: .png
日志在链接中:(我已经对其进行了几次测试,并将 .png 文件添加到名为 combine_files 的存储桶中几次)。
解决方案
推荐阅读
- java - 在不知道 JAVA 中的 registerOutParameter 的情况下执行存储的函数
- linux - 显示原始指令操作码和操作数的 Gdb 布局 asm 窗口
- c# - 如何从 Selenium C# 中的菜单下拉菜单中获取元素?
- ruby - 是否有可能删除行和列 XLSX
- syntax-error - 范围函数声明中的语法错误
- android - cordova android avd 访问 apache 服务器 xampp config.xml 权限
- ios - swift - 应用程序无法从另一个应用程序打开
- python - 无法使用熊猫将完整的数据透视表写入现有 Excel 工作簿中的新工作表
- javascript - 当数组包含嵌套对象数组中的输入值时获取对象
- javascript - 类型“只读<{}>”上不存在属性“产品”