I'm running into an issue with Serverless v1.5 (latest version currently available at the time of writing)
I've to add permission to the lambda function and I'm trying to achieve this by creating a CF template and running along with the deploy of the function:
resources:
Resources:
logsGroup:
Type: "AWS::Lambda::Permission"
Properties:
Action: lambda:InvokeFunction
FunctionName:
Fn::GetAtt:
- "${self:custom.${opt:stage}.name}"
- "Arn"
Principal: "logs.amazonaws.com"
SourceAccount:
Ref: "AWS::AccountId"
SourceArn: "arn:aws:logs:${self:provider.region}:*:log-group:*:*"
This is how it should look like. My problem is that when I try to deploy it I get an error which says that the function is not created yet which is understandable. How can I overcome to this issue? Any ideas?