2

I can create lambda trigger using S3- same region. But while creating trigger using different region S3 getting error

The bucket imebuckt must be in the same region as arn:aws:lambda:ap-south-1::function:ProcessImage.

How can i fix it?

sanjayparmar
  • 633
  • 8
  • 19

3 Answers3

5

S3 event can't trigger a lambda in a different region. What you can do is for example:

  • Send the S3 event to SNS topic or SQS queue and trigger lambda in your target region from that message.

  • Trigger Lambda in the same region from the S3 event and trigger your target region Lambda from the first Lambda.

  • Or a blend of the above two - Lambda in the S3 region sends a message to a SNS topic or SQS queue in the target region where your target lambda processes it.

I would do something like that. Hope that helps :)

MLu
  • 24,849
  • 5
  • 59
  • 86
0

Below can be an option

S3 (region-1) --> SNS (region-1) --> SQS (region-2) --> Lambda (region-2)

https://docs.aws.amazon.com/prescriptive-guidance/latest/patterns/subscribe-a-lambda-function-to-event-notifications-from-s3-buckets-in-different-aws-regions.html

  • 1
    Try to include important context in your answer, not just a link. From https://serverfault.com/help/how-to-answer: Links to external resources are encouraged, but please add context around the link so your fellow users will have some idea what it is and why it’s there. Always quote the most relevant part of an important link, in case the external resource is unreachable or goes permanently offline. Links to other websites should always be helpful, but avoid making it necessary to click on them as much as possible. – smithian Jul 12 '22 at 16:26
0

I think another solution is to call a Lambda in the same s3 region as a trigger and create another Lambda in your preferred region and use the Lambda's Function URL to post the payload to. This would be easier to setup than SES to SQS I think. Going to try it for myself.

Mattijs
  • 111
  • 1