I'm trying to configure a lambda S3 trigger for an existing bucket, but I'm getting the following error in Cloud Formation:
Unable to validate the following destination configurations (Service: Amazon S3; Status Code: 400; Error Code: InvalidArgument; Request ID: 0VZC1XMQ684D3764; S3 Extended Request ID: 2K+TABm48cA8QthjioLmNW2duzYoj3wtL/LAI6K1cO8YauBuNXKDs/fUSVxvux/zMZhDxbBR3/g=; Proxy: null)
Seems to be something related to lambda permission, but I have already setted the invoke permission.
YML especifications:
Lambda Invoke Permission (Already setted)
LambdaInvokePermission:
Type: 'AWS::Lambda::Permission'
Properties:
FunctionName: !GetAtt
- LambdaFunction
- Arn
Action: lambda:InvokeFunction
Principal: s3.amazonaws.com
SourceAccount: !Ref 'AWS::AccountId'
SourceArn: !Ref LambdaARN
AWS::S3::Bucket Notification (Here where error occurs)
NotificationConfiguration:
LambdaConfigurations:
- Event: 's3:ObjectCreated:*'
Function: !Ref LambdaARN
I find out that this error happened because of yml file indentation, I tried removing spaces in the event tag and it worked.