Cheap cheap wedding RSVP site

S3 Static Hosting, AWS API Gateway, Lambda and SNS for a 20 cent RSVP site.

Posted by Dan Ward on October 20, 2015

My (now)-wife and I were married at the start of October this year.

I wanted a nice way to get the RSVPs from our wedding guests, but needed a cheap way to do this.

AWS provide a nice and simple way of deploying static HTML and JS websites, through Amazon S3 Static hosting.

If you name your S3 Bucket the same name as your incoming domain name, you can seamlessly host the page is if it was on your own server (racking up usage charges every hour).

The best part about S3 - you are only paying for the traffic you are using. Since we had ~50 guests, the site will only really be loaded a maximum of 100 times.

danandcassgetmarried.com - The Site

Our requirements were simple - a landing page with a button for RSVP, and a form for the guests to enter their RSVP details.

danandcassgetmarried.com 01 The Landing Page

danandcassgetmarried.com 02 The RSVP Form

The page itself is very simple, you can view it on GitHub here.

The main guts of the Javascript here is to simply post the request off to AWS Gateway.

danandcassgetmarried.com - The API Gateway

Amazon's API gateway allows you to build HTTP endpoints that can be consumed by anything that can make the request. For Javascript, we need to enable CORS, which can be done through the convoluted process listed in the Amazon documentation here.

For my use case, I only need one endpoint created, a POST method on the endpoint /rsvp

danandcassgetmarried.com 03 The API Gateway Endpoint

danandcassgetmarried.com - The Lambda Function

Lambda is an amazing little service from AWS that allows you to run NodeJS (and now Python) code to interact with other AWS services.

The function below is receiving data from the webform, under the object 'event'. All we need to do is extract those details and create a string for a nice email message we can read when our guest RSVPs

danandcassgetmarried.com - The RSVP Email

For each POST through the API Gateway, we receive an SNS email message confirming our guest!

danandcassgetmarried.com 04 The final email message!

danandcassgetmarried.com - The Bill

So, our wedding is over, the site has done it's job. Let's see how much it actually cost me from AWS.

danandcassgetmarried.com 05 The Bill #1 - Nothing paid for the API Gateway danandcassgetmarried.com 06 The Bill #2 - SNS for emails, free too! danandcassgetmarried.com 07 The Bill #3 - Data Transfer, $0.06 danandcassgetmarried.com 08 The Bill #4 - S3, $0.06 danandcassgetmarried.com 09 The Bill #5 - Route 53 - $1

So, under $2! My Route53 entry here includes both the RSVP site, and my personal domain (dddanmar.net)

danandcassgetmarried.com - Finale

Very cool, we've used static hosting, custom domains, API Gateway, Lambda and SNS to create an RSVP site.

There are far more fine grained controls for API Gateway, but if you have the option to keep it simple, always keep it simple, stupid.