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

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 AWSAmazon Web Services
 
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 Amazon Web Services
 
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...Amazon Web Services
 
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 Amazon Web Services
 
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 Amazon Web Services
 
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 AttackAmazon Web Services
 
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 TalksAmazon Web Services
 
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...Amazon Web Services
 
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...Amazon Web Services
 
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 ServerlessChris Munns
 
Serverless is dead.
Serverless is dead.Serverless is dead.
Serverless is dead.Chris Munns
 
Building Serverless Microservices with AWS
Building Serverless Microservices with AWSBuilding Serverless Microservices with AWS
Building Serverless Microservices with AWSDonnie Prakoso
 
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 Amazon Web Services
 
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...Chris Munns
 
Deep Dive on Serverless Application Development
Deep Dive on Serverless Application DevelopmentDeep Dive on Serverless Application Development
Deep Dive on Serverless Application DevelopmentAmazon 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 AttacksAmazon Web Services
 
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 FargateAmazon Web Services
 
Deep Dive on Amazon Managed Blockchain
Deep Dive on Amazon Managed BlockchainDeep Dive on Amazon Managed Blockchain
Deep Dive on Amazon Managed BlockchainAmazon Web Services
 
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...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

Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesRohini Gaonkar
 
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
 
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 AWSIoannis Polyzos
 
Serverless APIs and you
Serverless APIs and youServerless APIs and you
Serverless APIs and youJames Beswick
 
20200513 - CloudComputing UCU
20200513 - CloudComputing UCU20200513 - CloudComputing UCU
20200513 - CloudComputing UCUMarcia Villalba
 
Leveraging serverless in fullstack development
Leveraging serverless in fullstack developmentLeveraging serverless in fullstack development
Leveraging serverless in fullstack developmentEric Johnson
 
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 2020Boaz Ziniman
 
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 CodeCobus Bernard
 
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 webAmazon Web Services
 
20200513 Getting started with AWS Amplify
20200513   Getting started with AWS Amplify20200513   Getting started with AWS Amplify
20200513 Getting started with AWS AmplifyMarcia Villalba
 
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) -...Amazon Web Services
 
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 AWSAmazon Web Services
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep DiveAmazon Web Services
 
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 KeynoteArun Gupta
 
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 ApplicationsAmazon Web Services
 
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 ...Amazon Web Services
 
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...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

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

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 nubeMarcia Villalba
 
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...Marcia Villalba
 
Building a personal brand
Building a personal brandBuilding a personal brand
Building a personal brandMarcia Villalba
 
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 serverlessMarcia Villalba
 
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 serverlessMarcia Villalba
 
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 serverlessMarcia Villalba
 
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 2020Marcia Villalba
 
ReInvent 2019 reCap Nordics
ReInvent 2019 reCap NordicsReInvent 2019 reCap Nordics
ReInvent 2019 reCap NordicsMarcia Villalba
 
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 GraphQLMarcia Villalba
 
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 GraphQLMarcia Villalba
 
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 ConferenceMarcia Villalba
 
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 stepsMarcia Villalba
 
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 practicasMarcia Villalba
 
Serverless Empowering people
Serverless Empowering peopleServerless Empowering people
Serverless Empowering peopleMarcia 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

2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
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 Performancesivaprakash250
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationBhangaleSonal
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf203318pmpc
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoordharasingh5698
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...soginsider
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfRagavanV2
 

Recently uploaded (20)

(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
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
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf22-prompt engineering noted slide shown.pdf
22-prompt engineering noted slide shown.pdf
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoorTop Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
Top Rated Call Girls In chittoor 📱 {7001035870} VIP Escorts chittoor
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
Hazard Identification (HAZID) vs. Hazard and Operability (HAZOP): A Comparati...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 

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