Biswajit Maharana
Biswajit Maharana

Reputation: 609

AWS EventBridge Event not triggering lambda function with proper permission

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.

enter image description here

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

Answers (2)

Arman Abdullah
Arman Abdullah

Reputation: 11

If multiple rules invoke the same lambda function add Source ARN like: arn:aws:events:YOUR_REGION:YOUR_ACCOUNT_ID:rule/*

See my Resource-based policy statement:

Upvotes: 0

Marcin
Marcin

Reputation: 238587

For EventBridge, principal should be events.amazonaws.com, not your function ARN.

Upvotes: 5

Related Questions