Schogini - Amazon AWS, Magento and Mobile Developers
 

Use Case: Contact Form to Email Using Amazon AWS Lambda CloudFront and SES for a Bootstrap Static - a Micro Service

Requirement

Implementation of a Micro Service using Amazon AWS Lambda to make a static website’s contact form send emails.

Challenges

Usually we need an end point to POST the contact for data to on a web server running PHP engine or a NodeJS etc. in order to be able to send the submitted form fields as an email or save to a database. However in this case there is no web server that can run such a dynamic content and provide an end point.

Solution

The solution that Schogini implemented has these elements:

  • Use AWS API Gateway Service to create a POST end point URL that can be connected to the contact form’s ACTION
  • Use AWS Lambda as NodeJS micro service provider to run our JavaScript code
  • Use AWS SES (Simple Email Service) to provide the sendmail/SMTP service needed for the JavaScript code running as a function inside the Lambda Service
  • CloudFront and S3 Bucket were used to deliver the static website
  • IAM Roles have been created to ensure that the Lambda Function has the right authority to access SES to send emails

Results

This solution works perfectly! CloudWatch logging has been enable to handle and thwart spam submissions. Throttle settings worked well to prevent repeated submissions.

Author

Sree - Founder/MD/Chief Cloud & DevOps Architect
Sree is an evangelist and thought leader in the Continuous Delivery and DevOps space. In addition to being a Cloud Architect, he also imparts training in AWS, Docker and other DevOps related technologies. Sree's core speciality is in building scripted, version-able, repeatable, auto-scaling, load-balanced and self-healing infrastructures. Sree also works in server-less architectures using AWS Lambda service and Internet of Things (IOT). Sree is also an Amazon Certified AWS Cloud Architect with 15+ years of server experience. He is also the author of Docker Fundamentals [Integrated Course] published by Packtpub.
Know more about the author.
 
 
 

CONTACT US

We love to talk to you, all enquires are replied to in under 4 hours.