Reputation: 150
I researched a lot but i'm not convinced or sure if it's possible or not, Your help would be really appreciated.
I want to learn if cross Region resource access is possible using resource based policy if yes then how in this case.
USE CASE:
Same Account Different Regions
AWS SES is in Account A and Region us-east-1
AWS Lambda Function is in Account A Region eu-central-1
I Want to accomplish AWS SES trigger AWS Lambda (Same Account Different Regions)
If this is not possible then your workaround would be appreciated, but understanding this is the main purpose here.
Upvotes: 1
Views: 1288
Reputation: 27300
I ran into this same problem, but for me the e-mails coming in via SES were important enough that I didn't want to lose them in the event that the Lambda failed (e.g. due to buggy code or a database outage).
So in my case I had SES use the S3 action instead, so SES would write the incoming e-mails to an S3 bucket. Then I set up a trigger on the S3 bucket to launch a Lambda in my preferred region when new objects appeared in S3.
This allowed the Lambdas to run in my preferred region, in response to e-mails arriving via SES, and if the Lambdas failed, the e-mails were still stored in the S3 bucket for later retry.
I just made my Lambda delete the files from S3 (or move them into a different folder) once the processing was complete, and added an extra task to periodically scan S3 for any files that hadn't been processed and launch the Lambda again, or alert if the files were old enough that the Lambda was clearly failing repeatedly.
Upvotes: 1
Reputation: 13632
It doesn't look like you can trigger cross region lambda from SES
The Amazon SNS topic you choose must be in the same AWS region as the Amazon SES endpoint you use to receive email.
See Lambda Action - Amazon Simple Email Service - AWS Documentation https://docs.aws.amazon.com/ses/latest/DeveloperGuide/receiving-email-action-lambda.html
As a workaround, consider using SQS based Subscribtions, to subscribe an Amazon SQS queue to an Amazon SNS topic in your target region.
Upvotes: 1