Gmail or Outlook to push notifications to SQS

1

I am working on a requirement, where we need to do some action (Email Processing (out of scope of this requirement)), whenever we receive an email in Client's Gmail or Outlook account.

Since we don't own these domains, so setting up Email Receiving Pipelines via SES (https://aws.amazon.com/getting-started/hands-on/setup-email-receiving-pipeline/faq/) is out of question here.

The solution that we thought of for this problem statement is Setting up a Gmail push notifications to hit AWS Api Gateway, which internally would call AWS Lambda for inserting data in SQS.

Changes involved are :- AWS:

  1. Create an SQS Queue.
  2. Create an AWS Lambda inserting data in SQS.
  3. Create an API Gateway invoking AWS Lambda.

Google Cloud:

  1. Create a Pub / Sub topic.
  2. Create a subscription for Api Gateway url.
  3. Create a watch on Gmail. The watcher would invoke topic on any change in Gmail.

Can someone please validate above approach?

1 Answer
0
Accepted Answer

That's a valid approach. Two comments:

  • If this is the only Lambda function you have you might also consider Lambda Function URLs - they are simpler to set up than API Gateway but also don't come with all the features that API Gateway does. So which you use is going to depend on what else you need.
  • You don't have to but you should be authenticating the caller somehow. That will also influence your decision on which endpoint type to use.
profile pictureAWS
EXPERT
answered 2 years ago
  • Just to add that if all your Lambda function does is to add the message to SQS, you can use direct service integration in API Gateway to send the message directly into SQS, without the Lambda function.

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.

Guidelines for Answering Questions