Reputation: 609
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
}
Upvotes: 2
Views: 7591
Reputation: 11
If multiple rules invoke the same lambda function add Source ARN like: arn:aws:events:YOUR_REGION:YOUR_ACCOUNT_ID:rule/*
Upvotes: 0
Reputation: 238587
For EventBridge, principal
should be events.amazonaws.com
, not your function ARN.
Upvotes: 5