我在下面有 CF 模板
我需要为 s3 PUT 事件触发 lambda 函数
Event type: ObjectCreatedByPut
https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-s3-notification-config/
AWSTemplateFormatVersion: "2010-09-09"
Transform: 'AWS::Serverless-2016-10-31'
rData:
Type: AWS::Serverless::Function
Properties:
CodeUri: functions/load_data
FunctionName: sample-function
Handler: lambda_function.lambda_handler
Runtime: python3.8
MemorySize: 3008
Timeout: 100
Role: !Sub arn:aws:iam::${AWS::AccountId}:role/main_service_role
Environment:
Variables:
bucket_name: sample-bucket
file_name: config/test.csv