A sample of a serverless stack using AWS presented a the Columbia AWS Meetup on October 20th, 2010. Find more details, a video presentation, and the resources used in this presentation @ https://www.thorntech.com/2016/10/serverless-website-aws-lambda/
1. CREATE A WEBSITE AND API WITH AWS
LAMBDA
A starting guide on the serverless stack
2. WHY SERVERLESS
• No server infrastructure management
• Scaling is simple and precise, only pay for what you
use
• Decoupled architecture keeps you agile
3. WHAT ISTHE SERVERLESS
STACK
• Route53 provides DNS
• CloudFront provides CDN/
HTTPS
• S3 Hosts Static Web Content
• DynamoDB or RDS provides
database
• API Gateway provides http(s)
endpoints
• Lambda executes business logic
5. STEP 1: SET UP DYNAMODB
• CreateVotesTable in
DynamoDB
6. STEP 2: SET UP LAMBDA
FUNCTION 1,THEVOTE CASTER
• Create a new Lambda with
microservice-http-endpoint
blueprint
• Modify code to update
Votes table
7. STEP 3: CONFIGURE API
GATEWAY
• The endpoint provided by the
Lambda blueprint is broken
• Delete the given endpoint and
create one from scratch
• Create Body MappingTemplate
to transform x-www-form-url-
encoded request
• Could add security layer with
Cognito User Pools and logging
to CloudWatch
8. STEP 4: SET UP S3 BUCKET
• Enable Static Website
Hosting
• Set bucket policy to enable
public access
• Upload html file
9. STEP 5: LAMBDA FUNCTION 2,
THEVOTETALLY READER
• Trigger from DynamoDB
table updates
• Write data.json file in S3