I have an eventbridge rule and it's configured with a lambda as a trigger. The eventbridge rule is a time based cronjob, I'm facing an issue with the eventbridge that it's not triggering the lambda function. I came across few answers and added lambda:InvokeFunction permission on lambda to the role but it's still not resolved yet.
Can anyone help me on this? The policy is added as part of terraform aws_lambda_permission to the lambda function. The lambda function is written in .Net
My terraform policy looks like this -
resource aws_lambda_permission allow_lambda_invoke {
statement_id = "AllowExecutionFromEventBridge"
action = "lambda:InvokeFunction"
function_name = aws_lambda_function.account_derive_and_publish_notes_handler.function_name
principal = aws_iam_role.account_lambda_role.arn
}
CodePudding user response:
For EventBridge, principal
should be events.amazonaws.com
, not your function ARN.