SlideShare a Scribd company logo
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Marcia Villalba
Developer Advocate AWS
@mavi888uy
Serverless with AWS
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
About me – Marcia Villalba
AWS Developer Advocate
Doing serverless since 2016
Host of FooBar YouTube Channel
https://youtube.com/foobar_codes
@mavi888uy
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Levelofabstraction
Focus on business logic
Physical machines Requires “guess” planning
Lives for years on-premises
Heavy investments (CAPEX)
Low innovation factor
Deploy in months
Computing evolution: A paradigm shift
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Levelofabstraction
Focus on business logic
Virtual machines
Hardware independence
Faster provisioning speed (minutes/hours)
Trade CAPEX for OPEX
More scale
Elastic resources
Faster speed and agility
Reduced maintenance
Computing evolution: A paradigm shift
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Levelofabstraction
Focus on business logic
Containerization
Platform independence
Consistent runtime environment
Higher resource utilization
Easier and faster deployments
Isolation and sandboxing
Start speed (deploy in seconds)
Computing evolution: A paradigm shift
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda
Levelofabstraction
Focus on business logic
Continuous scaling
Fault tolerance built in
Event-driven
Pay for value
Zero maintenance
Serverless
Computing evolution: A paradigm shift
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What it means that something is serverless?
No managing infrastructure High availability built in
Pay for what you useScales automagically
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Function as a Service (FaaS)
“AWS Lambda lets you run code without
provisioning or managing servers. ...
…Just upload your code and Lambda takes care
of everything required to run and scale your code
with high availability.
You can set up your code to automatically
trigger from other AWS services or call it directly
from any web or mobile app”
AWS – Lambda definition
AWS
Lambda
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How AWS Lambda works?
Event source Function Services
Node.js
Python
Java
C#
Go
Custom runtimes
Changes in
data state
Requests to
endpoints
Changes in
resource state
Amazon S3
DynamoDB
Amazon
SQS
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Managed services
Amazon S3
Amazon SQS
DynamoDB
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.@theburningmonk
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Why to use serverless?
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless is a change of mindset
”Serverless is a
methodology for
planning, building and
deploying software in a
way that maximizes value
by minimizing
undifferentiated heavy
lifting…”
Jeremy Daly
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Benefits of using serverless
• Focusing on what is important to your business
• Faster time to market
• Reduce initial investment
• Automagical scalability
• Modular and decouple architecture
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Common serverless use cases
Web
applications
• Static
websites
• Complex web
apps
• Packages for
Flask and
Express
Data
processing
• Real-time
• MapReduce
• Batch
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
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Let’s build something
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
The simplest serverless example
Amazon API Gateway
Was greeted?
Amazon DynamoDB
Client
Save a greeting
/hello
POST /hello
GET /hello
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Define the infrastructure
SaveHelloFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: handler.saveHello
Runtime: nodejs12.x
CodeUri: ./hello
Policies:
- DynamoDBCrudPolicy:
TableName: ExampleTable
Events:
HelloAPI:
Type: Api
Properties:
RestApiId: !Ref MyApi
Path: /hello
Method: POST
1 Lambda function
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Define the infrastructure
SaveHelloFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: handler.saveHello
Runtime: nodejs12.x
CodeUri: ./hello
Policies:
- DynamoDBCrudPolicy:
TableName: ExampleTable
Events:
HelloAPI:
Type: Api
Properties:
RestApiId: !Ref MyApi
Path: /hello
Method: POST
Function configuration
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Define the infrastructure
SaveHelloFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: handler.saveHello
Runtime: nodejs12.x
CodeUri: ./hello
Policies:
- DynamoDBCrudPolicy:
TableName: ExampleTable
Events:
HelloAPI:
Type: Api
Properties:
RestApiId: !Ref MyApi
Path: /hello
Method: POST
Function permissions
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Define the infrastructure
SaveHelloFunction:
Type: 'AWS::Serverless::Function’
Properties:
Handler: handler.saveHello
Runtime: nodejs12.x
CodeUri: ./hello
Policies:
- DynamoDBCrudPolicy:
TableName: ExampleTable
Events:
HelloAPI:
Type: Api
Properties:
RestApiId: !Ref MyApi
Path: /hello
Method: POST
Function trigger
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Define the infrastructure
API Gateway definition
MyApi:
Type: AWS::Serverless::Api
Properties:
StageName: dev
Cors:
AllowMethods: "'*’”
AllowHeaders: "'*’”
AllowOrigin: "'*'"
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Define the infrastructure
ExampleTable:
Type: "AWS::DynamoDB::Table"
Properties:
AttributeDefinitions:
- AttributeName: "name"
AttributeType: "S"
KeySchema:
- AttributeName: "name"
KeyType: "HASH"
BillingMode: 'PAY_PER_REQUEST’
TableName: 'ExampleTable'
DynamoDB table
definition
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Write the code
…
exports.saveHello = async (event) => {
const name = event.queryStringParameters.name;
const item = {
name: name,
date: Date.now()
}
const savedItem = await saveItem(item);
return {
statusCode: 200,
headers: {
'Access-Control-Allow-Origin': '*’
},
body: JSON.stringify(savedItem),
}
}
…
In the handler.js
Code that the
function will execute
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Deploy the project to the cloud
$ sam deploy --guided
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Test in postman
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Add the backend to a website
…
const wasGreeted = async () => {
const response = await fetch(
`${awsConfig.endpoint}hello?name=${name}`, {
mode: 'cors’
});
const responseData = await response.text();
setShowResult(true);
setApiMessage(responseData);
};
…
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Add the backend to a website
…
const wasGreeted = async () => {
const response = await fetch(
`${awsConfig.endpoint}hello?name=${name}`, {
mode: 'cors’
});
const responseData = await response.text();
setShowResult(true);
setApiMessage(responseData);
};
…
const awsconfig = {
"aws_project_region": "<REGION>",
"api_gateway_api_name": "<name of API>",
"endpoint": "<endpoint-URL>"
};
export default awsconfig;
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Testing it out
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Get the code
https://github.com/mavi888/first-serverless-app
© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!
Marcia Villalba
@mavi888uy
Youtube channel: http://bit.ly/foobar-youtube

More Related Content

What's hot (20)

PDF
20210216 AWS Black Belt Online Seminar AWS Database Migration Service
Amazon Web Services Japan
 
PDF
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
Amazon Web Services Korea
 
PDF
Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트
Amazon Web Services Korea
 
PDF
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
Open Source Consulting
 
PPTX
Azure DevOps in Action
Callon Campbell
 
PDF
Getting Started with Infrastructure as Code
WinWire Technologies Inc
 
PPTX
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Simplilearn
 
PDF
Elastic Observability
FaithWestdorp
 
PDF
Lambda를 활용한 서버없는 아키텍쳐 구현하기 :: 김기완 :: AWS Summit Seoul 2016
Amazon Web Services Korea
 
PDF
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
VMware Tanzu Korea
 
PDF
AWS를 이용한 렌더링 아키텍처 및 사용 사례 :: 박철수 솔루션즈 아키텍트 :: AWS Media Day
Amazon Web Services Korea
 
PDF
DevOps, Common use cases, Architectures, Best Practices
Shiva Narayanaswamy
 
PPTX
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
Simplilearn
 
PDF
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
Amazon Web Services Japan
 
PPTX
Azure DevOps
Felipe Artur Feltes
 
PDF
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Robert McDermott
 
PDF
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
Yevgeniy Brikman
 
PPTX
Airflow at lyft
Tao Feng
 
PDF
마이크로서비스 기반 클라우드 아키텍처 구성 모범 사례 - 윤석찬 (AWS 테크에반젤리스트)
Amazon Web Services Korea
 
PPTX
What is an API Gateway?
LunchBadger
 
20210216 AWS Black Belt Online Seminar AWS Database Migration Service
Amazon Web Services Japan
 
AWS IAM과 친해지기 – 조이정, AWS 솔루션즈 아키텍트:: AWS Builders Online Series
Amazon Web Services Korea
 
Amazon VPC와 ELB/Direct Connect/VPN 알아보기 - 김세준, AWS 솔루션즈 아키텍트
Amazon Web Services Korea
 
[오픈소스컨설팅] EFK Stack 소개와 설치 방법
Open Source Consulting
 
Azure DevOps in Action
Callon Campbell
 
Getting Started with Infrastructure as Code
WinWire Technologies Inc
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Simplilearn
 
Elastic Observability
FaithWestdorp
 
Lambda를 활용한 서버없는 아키텍쳐 구현하기 :: 김기완 :: AWS Summit Seoul 2016
Amazon Web Services Korea
 
MSA 전략 1: 마이크로서비스, 어떻게 디자인 할 것인가?
VMware Tanzu Korea
 
AWS를 이용한 렌더링 아키텍처 및 사용 사례 :: 박철수 솔루션즈 아키텍트 :: AWS Media Day
Amazon Web Services Korea
 
DevOps, Common use cases, Architectures, Best Practices
Shiva Narayanaswamy
 
What Is Ansible? | How Ansible Works? | Ansible Tutorial For Beginners | DevO...
Simplilearn
 
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
Amazon Web Services Japan
 
Azure DevOps
Felipe Artur Feltes
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Robert McDermott
 
How to test infrastructure code: automated testing for Terraform, Kubernetes,...
Yevgeniy Brikman
 
Airflow at lyft
Tao Feng
 
마이크로서비스 기반 클라우드 아키텍처 구성 모범 사례 - 윤석찬 (AWS 테크에반젤리스트)
Amazon Web Services Korea
 
What is an API Gateway?
LunchBadger
 

Similar to 20200803 - Serverless with AWS @ HELTECH (20)

PDF
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 
PDF
Getting Started with Serverless Architectures
Rohini Gaonkar
 
PDF
Serverless applications with AWS
javier ramirez
 
PPTX
awslambda-240508203904-07xsds253491.pptx
FarooqKhurshid1
 
PDF
20200520 - Como empezar a desarrollar aplicaciones serverless
Marcia Villalba
 
PDF
AWS Application Service Workshop - Serverless Architecture
John Yeung
 
PDF
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Boaz Ziniman
 
PDF
Modern Applications Development on AWS
Boaz Ziniman
 
PDF
Serverless Computing
Rushi Namani
 
PDF
Getting started building your first serverless web application on AWS
Ioannis Polyzos
 
PDF
Introduction to Serverless with AWS Lambda
Omar Fathy
 
PDF
Building Serverless Microservices with AWS
Donnie Prakoso
 
PDF
JFokus 2020 - How to migrate an application to serverless
Marcia Villalba
 
PDF
Designing Serverless Architectures on AWS
Rajitha Pathiraja
 
PDF
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
AWS Summits
 
PPTX
Primeros pasos en desarrollo serverless
javier ramirez
 
PDF
AWSomeDay Zurich 2018 - How to go serverless
Roman Plessl
 
PDF
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup
Boaz Ziniman
 
PDF
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
AWS Germany
 
PDF
How serverless helps startups innovate and scale
Gabe Hollombe
 
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 
Getting Started with Serverless Architectures
Rohini Gaonkar
 
Serverless applications with AWS
javier ramirez
 
awslambda-240508203904-07xsds253491.pptx
FarooqKhurshid1
 
20200520 - Como empezar a desarrollar aplicaciones serverless
Marcia Villalba
 
AWS Application Service Workshop - Serverless Architecture
John Yeung
 
Introducing to serverless computing and AWS lambda - Israel Clouds Meetup
Boaz Ziniman
 
Modern Applications Development on AWS
Boaz Ziniman
 
Serverless Computing
Rushi Namani
 
Getting started building your first serverless web application on AWS
Ioannis Polyzos
 
Introduction to Serverless with AWS Lambda
Omar Fathy
 
Building Serverless Microservices with AWS
Donnie Prakoso
 
JFokus 2020 - How to migrate an application to serverless
Marcia Villalba
 
Designing Serverless Architectures on AWS
Rajitha Pathiraja
 
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
AWS Summits
 
Primeros pasos en desarrollo serverless
javier ramirez
 
AWSomeDay Zurich 2018 - How to go serverless
Roman Plessl
 
Introduction to Serverless Computing and AWS Lambda - AWS IL Meetup
Boaz Ziniman
 
Modern Applications Web Day | Impress Your Friends with Your First Serverless...
AWS Germany
 
How serverless helps startups innovate and scale
Gabe Hollombe
 
Ad

More from Marcia Villalba (16)

PPTX
20210608 - Desarrollo de aplicaciones en la nube
Marcia Villalba
 
PDF
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
Marcia Villalba
 
PDF
20201013 - Serverless Architecture Conference - How to migrate your existing ...
Marcia Villalba
 
PPTX
Building a personal brand
Marcia Villalba
 
PDF
20200522 - How to migrate an existing app to serverless
Marcia Villalba
 
PDF
20200513 - CloudComputing UCU
Marcia Villalba
 
PDF
20200513 Getting started with AWS Amplify
Marcia Villalba
 
PDF
2020-04-02 DevConf - How to migrate an existing application to serverless
Marcia Villalba
 
PDF
Serverless <3 GraphQL - AWS UG Tampere 2020
Marcia Villalba
 
PDF
ReInvent 2019 reCap Nordics
Marcia Villalba
 
PDF
Serverless Days Milano - Developing Serverless applications with GraphQL
Marcia Villalba
 
PDF
AWS Stockholm Summit 19- Building serverless applications with GraphQL
Marcia Villalba
 
PDF
Serverless <3 GraphQL | 2019 - Serverless Architecture Conference
Marcia Villalba
 
PDF
Serverless Computing London 2018 - Migrating services to serverless in 10 steps
Marcia Villalba
 
PDF
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
Marcia Villalba
 
PDF
Serverless Empowering people
Marcia Villalba
 
20210608 - Desarrollo de aplicaciones en la nube
Marcia Villalba
 
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
Marcia Villalba
 
20201013 - Serverless Architecture Conference - How to migrate your existing ...
Marcia Villalba
 
Building a personal brand
Marcia Villalba
 
20200522 - How to migrate an existing app to serverless
Marcia Villalba
 
20200513 - CloudComputing UCU
Marcia Villalba
 
20200513 Getting started with AWS Amplify
Marcia Villalba
 
2020-04-02 DevConf - How to migrate an existing application to serverless
Marcia Villalba
 
Serverless <3 GraphQL - AWS UG Tampere 2020
Marcia Villalba
 
ReInvent 2019 reCap Nordics
Marcia Villalba
 
Serverless Days Milano - Developing Serverless applications with GraphQL
Marcia Villalba
 
AWS Stockholm Summit 19- Building serverless applications with GraphQL
Marcia Villalba
 
Serverless <3 GraphQL | 2019 - Serverless Architecture Conference
Marcia Villalba
 
Serverless Computing London 2018 - Migrating services to serverless in 10 steps
Marcia Villalba
 
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
Marcia Villalba
 
Serverless Empowering people
Marcia Villalba
 
Ad

Recently uploaded (20)

PDF
Statistical Data Analysis Using SPSS Software
shrikrishna kesharwani
 
PDF
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
PPTX
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
PPTX
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
PPTX
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
PDF
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PPTX
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
PPTX
site survey architecture student B.arch.
sri02032006
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PDF
monopile foundation seminar topic for civil engineering students
Ahina5
 
PPTX
Pharmaceuticals and fine chemicals.pptxx
jaypa242004
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PPTX
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
PPTX
Green Building & Energy Conservation ppt
Sagar Sarangi
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PDF
UNIT-4-FEEDBACK AMPLIFIERS AND OSCILLATORS (1).pdf
Sridhar191373
 
PPTX
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
PDF
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
PDF
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 
Statistical Data Analysis Using SPSS Software
shrikrishna kesharwani
 
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
MobileComputingMANET2023 MobileComputingMANET2023.pptx
masterfake98765
 
artificial intelligence applications in Geomatics
NawrasShatnawi1
 
Heart Bleed Bug - A case study (Course: Cryptography and Network Security)
Adri Jovin
 
International Journal of Information Technology Convergence and services (IJI...
ijitcsjournal4
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
Benefits_^0_Challigi😙🏡💐8fenges[1].pptx
akghostmaker
 
site survey architecture student B.arch.
sri02032006
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
monopile foundation seminar topic for civil engineering students
Ahina5
 
Pharmaceuticals and fine chemicals.pptxx
jaypa242004
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
Green Building & Energy Conservation ppt
Sagar Sarangi
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
UNIT-4-FEEDBACK AMPLIFIERS AND OSCILLATORS (1).pdf
Sridhar191373
 
Server Side Web Development Unit 1 of Nodejs.pptx
sneha852132
 
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 

20200803 - Serverless with AWS @ HELTECH

  • 1. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Marcia Villalba Developer Advocate AWS @mavi888uy Serverless with AWS
  • 2. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. About me – Marcia Villalba AWS Developer Advocate Doing serverless since 2016 Host of FooBar YouTube Channel https://youtube.com/foobar_codes @mavi888uy
  • 3. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Levelofabstraction Focus on business logic Physical machines Requires “guess” planning Lives for years on-premises Heavy investments (CAPEX) Low innovation factor Deploy in months Computing evolution: A paradigm shift
  • 4. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Levelofabstraction Focus on business logic Virtual machines Hardware independence Faster provisioning speed (minutes/hours) Trade CAPEX for OPEX More scale Elastic resources Faster speed and agility Reduced maintenance Computing evolution: A paradigm shift
  • 5. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Levelofabstraction Focus on business logic Containerization Platform independence Consistent runtime environment Higher resource utilization Easier and faster deployments Isolation and sandboxing Start speed (deploy in seconds) Computing evolution: A paradigm shift
  • 6. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. AWS Lambda Levelofabstraction Focus on business logic Continuous scaling Fault tolerance built in Event-driven Pay for value Zero maintenance Serverless Computing evolution: A paradigm shift
  • 7. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. What it means that something is serverless? No managing infrastructure High availability built in Pay for what you useScales automagically
  • 8. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 9. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Function as a Service (FaaS) “AWS Lambda lets you run code without provisioning or managing servers. ... …Just upload your code and Lambda takes care of everything required to run and scale your code with high availability. You can set up your code to automatically trigger from other AWS services or call it directly from any web or mobile app” AWS – Lambda definition AWS Lambda
  • 10. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. How AWS Lambda works? Event source Function Services Node.js Python Java C# Go Custom runtimes Changes in data state Requests to endpoints Changes in resource state Amazon S3 DynamoDB Amazon SQS
  • 11. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Managed services Amazon S3 Amazon SQS DynamoDB
  • 12. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
  • 13. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved.@theburningmonk
  • 14. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Why to use serverless?
  • 15. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Serverless is a change of mindset ”Serverless is a methodology for planning, building and deploying software in a way that maximizes value by minimizing undifferentiated heavy lifting…” Jeremy Daly
  • 16. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Benefits of using serverless • Focusing on what is important to your business • Faster time to market • Reduce initial investment • Automagical scalability • Modular and decouple architecture
  • 17. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Common serverless use cases Web applications • Static websites • Complex web apps • Packages for Flask and Express Data processing • Real-time • MapReduce • Batch 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
  • 18. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Let’s build something
  • 19. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. The simplest serverless example Amazon API Gateway Was greeted? Amazon DynamoDB Client Save a greeting /hello POST /hello GET /hello
  • 20. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Define the infrastructure SaveHelloFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: handler.saveHello Runtime: nodejs12.x CodeUri: ./hello Policies: - DynamoDBCrudPolicy: TableName: ExampleTable Events: HelloAPI: Type: Api Properties: RestApiId: !Ref MyApi Path: /hello Method: POST 1 Lambda function
  • 21. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Define the infrastructure SaveHelloFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: handler.saveHello Runtime: nodejs12.x CodeUri: ./hello Policies: - DynamoDBCrudPolicy: TableName: ExampleTable Events: HelloAPI: Type: Api Properties: RestApiId: !Ref MyApi Path: /hello Method: POST Function configuration
  • 22. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Define the infrastructure SaveHelloFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: handler.saveHello Runtime: nodejs12.x CodeUri: ./hello Policies: - DynamoDBCrudPolicy: TableName: ExampleTable Events: HelloAPI: Type: Api Properties: RestApiId: !Ref MyApi Path: /hello Method: POST Function permissions
  • 23. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Define the infrastructure SaveHelloFunction: Type: 'AWS::Serverless::Function’ Properties: Handler: handler.saveHello Runtime: nodejs12.x CodeUri: ./hello Policies: - DynamoDBCrudPolicy: TableName: ExampleTable Events: HelloAPI: Type: Api Properties: RestApiId: !Ref MyApi Path: /hello Method: POST Function trigger
  • 24. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Define the infrastructure API Gateway definition MyApi: Type: AWS::Serverless::Api Properties: StageName: dev Cors: AllowMethods: "'*’” AllowHeaders: "'*’” AllowOrigin: "'*'"
  • 25. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Define the infrastructure ExampleTable: Type: "AWS::DynamoDB::Table" Properties: AttributeDefinitions: - AttributeName: "name" AttributeType: "S" KeySchema: - AttributeName: "name" KeyType: "HASH" BillingMode: 'PAY_PER_REQUEST’ TableName: 'ExampleTable' DynamoDB table definition
  • 26. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Write the code … exports.saveHello = async (event) => { const name = event.queryStringParameters.name; const item = { name: name, date: Date.now() } const savedItem = await saveItem(item); return { statusCode: 200, headers: { 'Access-Control-Allow-Origin': '*’ }, body: JSON.stringify(savedItem), } } … In the handler.js Code that the function will execute
  • 27. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Deploy the project to the cloud $ sam deploy --guided
  • 28. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Test in postman
  • 29. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Add the backend to a website … const wasGreeted = async () => { const response = await fetch( `${awsConfig.endpoint}hello?name=${name}`, { mode: 'cors’ }); const responseData = await response.text(); setShowResult(true); setApiMessage(responseData); }; …
  • 30. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Add the backend to a website … const wasGreeted = async () => { const response = await fetch( `${awsConfig.endpoint}hello?name=${name}`, { mode: 'cors’ }); const responseData = await response.text(); setShowResult(true); setApiMessage(responseData); }; … const awsconfig = { "aws_project_region": "<REGION>", "api_gateway_api_name": "<name of API>", "endpoint": "<endpoint-URL>" }; export default awsconfig;
  • 31. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Testing it out
  • 32. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Get the code https://github.com/mavi888/first-serverless-app
  • 33. © 2020, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you! Marcia Villalba @mavi888uy Youtube channel: http://bit.ly/foobar-youtube