Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
CREATE A WEBSITE AND API WITH AWS
LAMBDA
A starting guide on the serverless stack
WHY SERVERLESS
• No server infrastructure management
• Scaling is simple and precise, only pay for what you
use
• Decouple...
WHAT ISTHE SERVERLESS
STACK
• Route53 provides DNS
• CloudFront provides CDN/
HTTPS
• S3 Hosts Static Web Content
• Dynamo...
VOTING APP ARCHITECTURE
Created with https://cloudcraft.co/
STEP 1: SET UP DYNAMODB
• CreateVotesTable in
DynamoDB
STEP 2: SET UP LAMBDA
FUNCTION 1,THEVOTE CASTER
• Create a new Lambda with
microservice-http-endpoint
blueprint
• Modify c...
STEP 3: CONFIGURE API
GATEWAY
• The endpoint provided by the
Lambda blueprint is broken
• Delete the given endpoint and
cr...
STEP 4: SET UP S3 BUCKET
• Enable Static Website
Hosting
• Set bucket policy to enable
public access
• Upload html file
STEP 5: LAMBDA FUNCTION 2,
THEVOTETALLY READER
• Trigger from DynamoDB
table updates
• Write data.json file in S3
FRAMEWORKS
• Serverless: https://serverless.com/
• apex: http://apex.run/
• chalice (python): https://github.com/awslabs/c...
THANKYOU!
QUESTIONS?
Dan Rusk
danrusk@thorntech.com
Upcoming SlideShare
Loading in …5
×

Create a Website and API with AWS Lambda

10,938 views

Published on

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/

Published in: Technology
  • Be the first to comment

Create a Website and API with AWS Lambda

  1. 1. CREATE A WEBSITE AND API WITH AWS LAMBDA A starting guide on the serverless stack
  2. 2. WHY SERVERLESS • No server infrastructure management • Scaling is simple and precise, only pay for what you use • Decoupled architecture keeps you agile
  3. 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
  4. 4. VOTING APP ARCHITECTURE Created with https://cloudcraft.co/
  5. 5. STEP 1: SET UP DYNAMODB • CreateVotesTable in DynamoDB
  6. 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. 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. 8. STEP 4: SET UP S3 BUCKET • Enable Static Website Hosting • Set bucket policy to enable public access • Upload html file
  9. 9. STEP 5: LAMBDA FUNCTION 2, THEVOTETALLY READER • Trigger from DynamoDB table updates • Write data.json file in S3
  10. 10. FRAMEWORKS • Serverless: https://serverless.com/ • apex: http://apex.run/ • chalice (python): https://github.com/awslabs/chalice • aws-serverless-express: https://github.com/awslabs/ aws-serverless-express
  11. 11. THANKYOU! QUESTIONS? Dan Rusk danrusk@thorntech.com

×