Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Get Started with Your Serverless API

Get Started with Your Serverless API

Wondering how you can start your first serverless API in no time? This deck will show you how, along with the demo and also source code available on Github. Deck, demo and source code was prepared for AWS User Group meetup in Bandung, Indonesia.

Donnie Prakoso

November 16, 2018
Tweet

More Decks by Donnie Prakoso

Other Decks in Technology

Transcript

  1. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Donnie Prakoso AWS Technology Evangelist, ASEAN Get Started with Your Serverless API Deep Dive into AWS SAM @donnieprakoso donnieprakoso
  2. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark > hello, world Donnie Prakoso, MSc Technical Evangelist, AWS @donnieprakoso donnieprakoso • Speak in Go and Python • Container, Machine Learning and Serverless • I AWS User Groups • Temennya Petra, Aswin, dan semua developers
  3. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark What We Are Going to Discuss • What really happen behind “Let’s Build an App!” • Setting foundation of serverless paradigm • Serverless is bigger than FaaS • Introducing AWS SAM • Creating your first API • Thank you!
  4. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Let’s Build an App!
  5. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Presentation Tier Logic Tier Data Tier Mobile App App Server Database
  6. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Here is what that translates to in real life http://media.amazonwebservices.com/architecturecenter/AWS_ac_ra_web_01.pdf
  7. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark
  8. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Server-less Computing Serverless computing allows you to build and run applications and services without thinking about servers.
  9. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Because time is valuable
  10. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Serverless Means … No servers to provision or manage Scales with usage Never pay for idle Built in availability and fault tolerance
  11. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Serverless Applications Services (anything) Changes in data state Requests to endpoints Changes in resource state Event source Lambda function Node.js Python Java C# Go
  12. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Focus on building business logic. !
  13. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Common Serverless Application Use Cases Web applications • Static websites • Complex web apps • Packages for Flask and Express Data processing • Real-time • MapReduce • Batch • Machine learning inference Chatbots • Powering chatbot logic Backends • Apps and services • Mobile • IoT </> </> Amazon Alexa • Powering voice-enabled apps • Alexa Skills Kit IT automation • Policy engines • Extending AWS services • Infrastructure management
  14. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Translating this… http://media.amazonwebservices.com/architecturecenter/AWS_ac_ra_web_01.pdf …to
  15. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark The server-less stack Internet Mobile apps AWS Lambda functions AWS API Gateway Other AWS services
  16. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Meet AWS SAM.
  17. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark https://bit.ly/demo-vote-for-martabaks DEMO SOURCE CODE https://github.com/donnieprakoso/vote-for-martabaks
  18. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark sam init sam local start-api sam package sam validate sam deploy sam logs 1 Create project 2 Test locally 3 Validate template 4 Package into CF 5 Deploy 6 Check the logs Development Deployment Monitoring
  19. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark Lambda execution model Synchronous (push) Asynchronous (event) Stream-based Amazon API Gateway AWS Lambda function Amazon DynamoDB Amazon SNS /order AWS Lambda function Amazon S3 reqs Amazon Kinesis changes AWS Lambda service function
  20. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark In Summary • Serverless is not only the underlying technology but also a paradigm • AWS SAM helps you to kickstart your project • Start with defining your resources. Start small. • Automate resources creation, packaging and deployment • Centralized monitoring tool
  21. © 2018, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. Amazon Confidential and Trademark © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Go Build! Donnie Prakoso AWS Technology Evangelist, ASEAN @donnieprakoso donnieprakoso