SlideShare a Scribd company logo
1 of 33
Download to read offline
© 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

Best Practices to Mitigate from the Emerging Vectors of Network Attack
Best Practices to Mitigate from the Emerging Vectors of Network AttackBest Practices to Mitigate from the Emerging Vectors of Network Attack
Best Practices to Mitigate from the Emerging Vectors of Network Attack
Amazon Web Services
 
Protect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced AttacksProtect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced Attacks
Amazon Web Services
 

What's hot (20)

Scaling threat detection and response on AWS
Scaling threat detection and response on AWSScaling threat detection and response on AWS
Scaling threat detection and response on AWS
 
Securing your block storage on AWS - GRC207 - AWS re:Inforce 2019
Securing your block storage on AWS - GRC207 - AWS re:Inforce 2019 Securing your block storage on AWS - GRC207 - AWS re:Inforce 2019
Securing your block storage on AWS - GRC207 - AWS re:Inforce 2019
 
Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...
Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...
Cross-account encryption with AWS KMS and Slack Enterprise Key Management - S...
 
Establishing AWS as a trusted partner - GRC325 - AWS re:Inforce 2019
Establishing AWS as a trusted partner - GRC325 - AWS re:Inforce 2019 Establishing AWS as a trusted partner - GRC325 - AWS re:Inforce 2019
Establishing AWS as a trusted partner - GRC325 - AWS re:Inforce 2019
 
Achieving security goals with AWS CloudHSM - SDD333 - AWS re:Inforce 2019
Achieving security goals with AWS CloudHSM - SDD333 - AWS re:Inforce 2019 Achieving security goals with AWS CloudHSM - SDD333 - AWS re:Inforce 2019
Achieving security goals with AWS CloudHSM - SDD333 - AWS re:Inforce 2019
 
Best Practices to Mitigate from the Emerging Vectors of Network Attack
Best Practices to Mitigate from the Emerging Vectors of Network AttackBest Practices to Mitigate from the Emerging Vectors of Network Attack
Best Practices to Mitigate from the Emerging Vectors of Network Attack
 
Deep Dive on AWS Single Sign-On - AWS Online Tech Talks
Deep Dive on AWS Single Sign-On - AWS Online Tech TalksDeep Dive on AWS Single Sign-On - AWS Online Tech Talks
Deep Dive on AWS Single Sign-On - AWS Online Tech Talks
 
Enforcing security invariants with AWS Organizations - SDD314 - AWS re:Inforc...
Enforcing security invariants with AWS Organizations - SDD314 - AWS re:Inforc...Enforcing security invariants with AWS Organizations - SDD314 - AWS re:Inforc...
Enforcing security invariants with AWS Organizations - SDD314 - AWS re:Inforc...
 
Scale permissions management in AWS with attribute-based access control - SDD...
Scale permissions management in AWS with attribute-based access control - SDD...Scale permissions management in AWS with attribute-based access control - SDD...
Scale permissions management in AWS with attribute-based access control - SDD...
 
All the Ops you need to know to Dev Serverless
All the Ops you need to know to Dev ServerlessAll the Ops you need to know to Dev Serverless
All the Ops you need to know to Dev Serverless
 
Serverless is dead.
Serverless is dead.Serverless is dead.
Serverless is dead.
 
Building Serverless Microservices with AWS
Building Serverless Microservices with AWSBuilding Serverless Microservices with AWS
Building Serverless Microservices with AWS
 
Containers and mission-critical applications - SEP309-R - AWS re:Inforce 2019
Containers and mission-critical applications - SEP309-R - AWS re:Inforce 2019 Containers and mission-critical applications - SEP309-R - AWS re:Inforce 2019
Containers and mission-critical applications - SEP309-R - AWS re:Inforce 2019
 
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
 
Deep Dive on Serverless Application Development
Deep Dive on Serverless Application DevelopmentDeep Dive on Serverless Application Development
Deep Dive on Serverless Application Development
 
Protect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced AttacksProtect your applications from DDoS/BOT & Advanced Attacks
Protect your applications from DDoS/BOT & Advanced Attacks
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and Fargate
 
Deep Dive on Amazon Managed Blockchain
Deep Dive on Amazon Managed BlockchainDeep Dive on Amazon Managed Blockchain
Deep Dive on Amazon Managed Blockchain
 
Building with Containers on AWS
Building with Containers on AWSBuilding with Containers on AWS
Building with Containers on AWS
 
Unify security, compliance, and finance teams with governance at scale - GRC2...
Unify security, compliance, and finance teams with governance at scale - GRC2...Unify security, compliance, and finance teams with governance at scale - GRC2...
Unify security, compliance, and finance teams with governance at scale - GRC2...
 

Similar to 20200803 - Serverless with AWS @ HELTECH

20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless 20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless
Marcia Villalba
 

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

Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless 20200520 - Como empezar a desarrollar aplicaciones serverless
20200520 - Como empezar a desarrollar aplicaciones serverless
 
Getting started building your first serverless web application on AWS
Getting started building  your first serverless web application on AWSGetting started building  your first serverless web application on AWS
Getting started building your first serverless web application on AWS
 
Serverless APIs and you
Serverless APIs and youServerless APIs and you
Serverless APIs and you
 
20200513 - CloudComputing UCU
20200513 - CloudComputing UCU20200513 - CloudComputing UCU
20200513 - CloudComputing UCU
 
Leveraging serverless in fullstack development
Leveraging serverless in fullstack developmentLeveraging serverless in fullstack development
Leveraging serverless in fullstack development
 
What can you do with Serverless in 2020
What can you do with Serverless in 2020What can you do with Serverless in 2020
What can you do with Serverless in 2020
 
AWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as Code
AWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as CodeAWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as Code
AWS SSA Webinar 28 - Getting Started with AWS - Infrastructure as Code
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
20200513 Getting started with AWS Amplify
20200513   Getting started with AWS Amplify20200513   Getting started with AWS Amplify
20200513 Getting started with AWS Amplify
 
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
 
Migrate & Modernize your legacy Microsoft applications with AWS
Migrate & Modernize your legacy Microsoft applications with AWSMigrate & Modernize your legacy Microsoft applications with AWS
Migrate & Modernize your legacy Microsoft applications with AWS
 
Introduction to Serverless
Introduction to ServerlessIntroduction to Serverless
Introduction to Serverless
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
AWS Outposts Update
AWS Outposts UpdateAWS Outposts Update
AWS Outposts Update
 
The Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 KeynoteThe Serverless Tidal Wave - SwampUP 2018 Keynote
The Serverless Tidal Wave - SwampUP 2018 Keynote
 
Introduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsIntroduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless Applications
 
Intro to AWS Lambda and Serverless Applications: re:Invent 2018 Recap at the ...
Intro to AWS Lambda and Serverless Applications: re:Invent 2018 Recap at the ...Intro to AWS Lambda and Serverless Applications: re:Invent 2018 Recap at the ...
Intro to AWS Lambda and Serverless Applications: re:Invent 2018 Recap at the ...
 
Control for Your Cloud Environment Using AWS Management Tools (ENT226-R1) - A...
Control for Your Cloud Environment Using AWS Management Tools (ENT226-R1) - A...Control for Your Cloud Environment Using AWS Management Tools (ENT226-R1) - A...
Control for Your Cloud Environment Using AWS Management Tools (ENT226-R1) - A...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

More from Marcia Villalba

More from Marcia Villalba (14)

20210608 - Desarrollo de aplicaciones en la nube
20210608 - Desarrollo de aplicaciones en la nube20210608 - Desarrollo de aplicaciones en la nube
20210608 - Desarrollo de aplicaciones en la nube
 
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
20201012 - Serverless Architecture Conference - Deploying serverless applicat...20201012 - Serverless Architecture Conference - Deploying serverless applicat...
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
 
Building a personal brand
Building a personal brandBuilding a personal brand
Building a personal brand
 
20200522 - How to migrate an existing app to serverless
20200522 - How to migrate an existing app to serverless20200522 - How to migrate an existing app to serverless
20200522 - How to migrate an existing app to serverless
 
2020-04-02 DevConf - How to migrate an existing application to serverless
2020-04-02 DevConf - How to migrate an existing application to serverless2020-04-02 DevConf - How to migrate an existing application to serverless
2020-04-02 DevConf - How to migrate an existing application to serverless
 
JFokus 2020 - How to migrate an application to serverless
JFokus 2020 - How to migrate an application to serverlessJFokus 2020 - How to migrate an application to serverless
JFokus 2020 - How to migrate an application to serverless
 
Serverless <3 GraphQL - AWS UG Tampere 2020
Serverless <3 GraphQL - AWS UG Tampere 2020Serverless <3 GraphQL - AWS UG Tampere 2020
Serverless <3 GraphQL - AWS UG Tampere 2020
 
ReInvent 2019 reCap Nordics
ReInvent 2019 reCap NordicsReInvent 2019 reCap Nordics
ReInvent 2019 reCap Nordics
 
Serverless Days Milano - Developing Serverless applications with GraphQL
Serverless Days Milano - Developing Serverless applications with GraphQLServerless Days Milano - Developing Serverless applications with GraphQL
Serverless Days Milano - Developing Serverless applications with GraphQL
 
AWS Stockholm Summit 19- Building serverless applications with GraphQL
AWS Stockholm Summit 19- Building serverless applications with GraphQLAWS Stockholm Summit 19- Building serverless applications with GraphQL
AWS Stockholm Summit 19- Building serverless applications with GraphQL
 
Serverless <3 GraphQL | 2019 - Serverless Architecture Conference
Serverless <3 GraphQL | 2019 - Serverless Architecture ConferenceServerless <3 GraphQL | 2019 - Serverless Architecture Conference
Serverless <3 GraphQL | 2019 - Serverless Architecture Conference
 
Serverless Computing London 2018 - Migrating services to serverless in 10 steps
Serverless Computing London 2018 - Migrating services to serverless in 10 stepsServerless Computing London 2018 - Migrating services to serverless in 10 steps
Serverless Computing London 2018 - Migrating services to serverless in 10 steps
 
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicasOctubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
Octubre 2018 - AWS UG Montevideo - Intro a Serverless y buenas practicas
 
Serverless Empowering people
Serverless Empowering peopleServerless Empowering people
Serverless Empowering people
 

Recently uploaded

result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Recently uploaded (20)

UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 

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