0

I had successfully deployed an AWS Lambda function to receive Image Scan events from AWS ECR. The region I was using was ap-southeast-1. However, I had noticed that the Lambda function could not receive events from AWS ECR from another region (i.e eu-central-1).

Is there a way to make my Lambda to receive event from AWS ECR in another region without having to deploy it in multiple regions?

Thanks!

Genzer

Genzer
  • 2,921
  • 2
  • 25
  • 38

2 Answers2

0

This depends on how ECR sends events to EventBridge. I'm not certain but most AWS services send events within the same region only. So eu-central-1 events are in eu-central-1 only. The easiest workaround would be to deploy the same function in all regions.

You can also leverage API-Gateway's multi-region abilities. This blog shows a slightly different use-case but may be helpful in understanding how to call a cross-region lambda https://aws.amazon.com/blogs/compute/building-a-multi-region-serverless-application-with-amazon-api-gateway-and-aws-lambda/

In all cases, you need to create a rule in each region you need to reach ECR events and send them to a same-region target.

blr
  • 908
  • 4
  • 8
0

My understanding of EventBridge events is similar to @blr's, but I've gotten around this by having the events go to a queue first, which the lambda can then be subscribed to across regions. It seems to be a bit lower overhead than deploying the lambda function in every region.

zyd
  • 833
  • 7
  • 16