Invoke a lambda function (cross account) from event bridge

0

Is it possible to invoke a lambda function in account A directly from event bridge (custom event bus) in account B without integrating with an event bus in account A?

질문됨 2년 전7382회 조회
2개 답변
7
수락된 답변

Hi there,

At this point sending events cross-account is only supported via Event Buses which means that it is not possible to directly set a target of Lambda-in-AccountA to an EventBridge Rule Rule-in-AccountB. The supported flow would be as below:

Event-Bus-AccountB => Rule-in-AccountB => Event-Bus-AccountA as one of the Target => Rule-in-AccountA to match the events coming from AccountB and with a Target of Lambda-in-AccountA.

To help you further understand, here are some useful resources Sending and Receiving events between AWS Accounts and Simplifying cross-account access with Amazon EventBridge Resource policies

Hope this helps, and please let me know if you have any further questions

AWS
지원 엔지니어
답변함 2년 전
  • The flow Event-Bus-AccountB=>Rule-in-AccountB=>SQS-in-AccountB=>Lambda-in-AccountA looks to be supported now. As recently Lambda service announced the support of invocation from SQS Queue in a different AWS account. You can check the details from https://aws.amazon.com/about-aws/whats-new/2021/09/aws-lambda-lambda-function-amazon-sqs-queue/

  • In case it's not possible to use event bus in account A as a target. Any other options to invoke Lambda-in-AccountA when an event is published on Event-Bus-AccountB? Is Event-Bus-AccountB=>Rule-in-AccountB=>SQS-in-AccountB=>Lambda-in-AccountA a feasible alternative?

0

I don't think this is possible.

With EventBridge, it's possible to configure an event bus to receive events from different sources including sources from other AWS accounts. To invoke a lambda function - this would be done via Event Bus -> Rule -> Target (in this case, the target would be a lambda function). Currently, it seems that the Lambda function must be in the same account as the Rule.

If you're looking to do extra architecture, a couple solutions could be as follows:

jsonc
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠