Skip to content

Eventbridge to Lambda - NotAuthorizedForSourceException

0

Hello, I am working on a an EventBridge rule that detects an start of an RDS instance and triggers a Lambda function. I have got most if it down but the first phase testing, sending an event from eventbridge to lambda isn't working.

Take a sample event like the one shown below, I am using the send event feature from eventbridge console to lambda function. The eventbridge console complains Error. NotAuthorizedForSourceException. Not authorized for the source.

Enter image description here Enter image description here

Appears that it is for safety that one cannot use aws.rds as source but it also restricts me from testing the eventbring to lambda flow. How can I get around it?

1 Answer
2
Accepted Answer

Hello.

"aws.rds" can only be used in events created by AWS, so I don't think it can be used when creating test EventBridge events.
So, when testing, why not change it to something like "test.rds" instead of "aws.rds"?

By the way, if you set SQS DLQ as the EventBridge target as described in the document below, you may be able to troubleshoot the cause of the failure to send from the event that failed to send.
https://repost.aws/knowledge-center/eventbridge-lambda-not-triggered

EXPERT
answered 2 years ago
EXPERT
reviewed 2 years ago
EXPERT
reviewed 2 years ago
  • thanks, that's what I ended up doing. I just want to check if I am using EventID correctly under detail to get the right event?

    Type: AWS::Events::Rule
        Properties: 
          EventPattern: 
            source: 
              - "aws.rds"
            detail-type:
              - "RDS DB Instance Event"
            detail:
              EventID:
                - "RDS-EVENT-0049"
          State: "ENABLED"
    
  • If you can send an email on SNS using that event pattern, you can check the contents of the event. So, please try using SNS instead of Lambda to check if the event pattern works.

  • By the way, Lambda worked with the following event pattern, so I think there is a problem with the resource-based policy on the Lambda side.

    {
      "source": ["aws.rds"],
      "detail-type": ["RDS DB Instance Event"],
      "detail": {
        "EventID": ["RDS-EVENT-0049"]
      }
    }
    

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.