【发布时间】:2021-05-25 10:38:15
【问题描述】:
我创建了一个带有以下模板的存储桶触发器
我只需要为 test-bucket-3422344 中的文件夹 test/sample/ 触发
AWSTemplateFormatVersion: "2010-09-09"
Transform: 'AWS::Serverless-2016-10-31'
Resources:
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: test-bucket-3422344
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
Events:
S3Event:
Type: S3
Properties:
Bucket: !Ref MyBucket
Events: s3:ObjectCreated:Put
我添加了类似下面的过滤器与事件并行
Filter:
S3Key:
Rules:
- Name: prefix
- Value: test/sample
我有错误
E0001 Error transforming template: Resource with id [rData] is invalid. property Filter not defined for resource of type AWS::Serverless::Function```
【问题讨论】:
标签: amazon-web-services yaml amazon-cloudformation