Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.8k views
in Technique[技术] by (71.8m points)

amazon web services - AWS Help, Email to S3 to Lambda to Push Notification

So my plan is to receive an email which will be saved to an s3 bucket and also trigger a lambda function which will send a mobile push notification. Firstly is it possible, I've worked on this for a while and I'm pretty sure it is, although errors keep popping up. My current problem is that my emails are not saving into my S3 bucket, when they are saved this message from AWS comes up - message saved in S3 Bucket

Any help is very appreciated, and maybe some other opinions on my plan would also be fantastic.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes, it is possible :) The message in your screenshot just lets you know that you have successfully setup the S3 receipt rule action.

On a high level you have to take the following steps:

  1. Verify your domain to receive emails. This means adding certain DNS records that point to AWS SES. It's easy to do this if your domain is registered with Route53 because the UI in SES offers you to do that with a button click. Explained here for Route53 For other domain providers you have to take a few more manual steps: Add a TXT record pointing to SES to prove you own the domain and Add an MX record pointing to SES for receiving mails
  2. Create a receipt rule set in AWS SES. This allows you to configure what should happen when you receive an email for certain email address(es). Explained here The detailed config what should happen is defined in receipt rules.
  3. For this rule set, setup a receipt rule to store the email file in S3. Also explained here
  4. For this rule set, setup another receipt rule to trigger a Lambda function that sends you a notification or does whatever you want to do with the email. Lambda Action options explained here (Alternatively, you can setup an SNS Action and trigger an SNS topic to which you subscribe using your phone number - however, the SNS message will be a JSON string that includes all metadata as well, so it's not easy to read -> I'd preprocess it first using a Lambda function and that's what you probably want to do)

Did you follow these steps? Is there any error happening?

All these steps require quite a bit of manual work. Also, it's tough to setup more complex scenarios in case this is necessary and requires you to manually adjust the settings like changing a receipt rule. Depending on what you want to achieve, I can recommend you to look into some further links that help you creating these environments for you in a (semi-)automated way:

If you have more questions, just let me know.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...