Closed
Description
Description:
When a lambda function has S3 event, this lambda function can be invoked by any service (not just S3).
Steps to reproduce:
MyLambdaFunction:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub ${AWS::StackName}-hello
CodeUri: hello/
Handler: lambda_function.lambda_handler
Runtime: python3.12
Role: !GetAtt MyLambdaFunctionRole.Arn
Events:
S3FileAdded:
Type: S3
Properties:
Bucket: !Ref MyBucket
Events:
- s3:ObjectCreated:*
Filter:
S3Key:
Rules:
- Name: prefix
Value: inbox/
- Name: suffix
Value: .txt
Observed result:
When permission is created, it looks like that:
{
"StringEquals": {
"AWS:SourceAccount": "123123123123"
}
}
Expected result:
I'd like Type: S3
to be same as Type: Schedule
produce:
{
"ArnLike": {
"AWS:SourceArn": "arn:aws:events:us-east-1:123123123123:rule/hello-world"
}
}
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: macOS-*******-x86_64-i386-64bit
- Python: 3.12.2
sam --version
: SAM CLI, version 1.116.0- AWS region: us-east-1