SlideShare una empresa de Scribd logo
1 de 27
Descargar para leer sin conexión
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Angela Wang – AWS Solutions Architect
Thirty Serverless Architectures in
30 Minutes
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Angela Wang – AWS Solutions Architect
Thirty Serverless Architectures in
30 MinutesX
X
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
https://secure.flickr.com/photos/mgifford/4525333972
Why are we
here today?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
No servers to provision
or manage
Scales with usage
Never pay for idle Availability and fault tolerance
built in
Serverless means …
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless applications
Services (anything)
Changes in
data state
Requests to
endpoints
Changes in
resource state
Event source Function
Node.js
Python
Java
C#
Go
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Common use cases for AWS Lambda
Web
applications
• Static websites
• Complex web
apps
• Packages for
Flask and
Express
Data
processing
• Real time
• MapReduce
• Batch
Chatbots
• Powering
chatbot logic
Backends
• Apps & services
• Mobile
• IoT
</></>
Amazon Alexa
• Powering
voice-enabled
apps
• Alexa Skills Kit
IT automation
• Policy engines
• Extending AWS
services
• Infrastructure
management
Lambda execution models
Synchronous (push) Asynchronous (event) Poll-Based
Amazon
API Gateway
Lambda
function
Amazon
DynamoDBAmazon
SNS
/order
Lambda
function
Amazon
S3
reqs
Amazon Kinesis
changes
Lambda service
function
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda execution models
Poll-based
Amazon SQS
Messages
AWS Lambda
service
Lambda function
New New
Lambda permissions model
Fine-grained security controls for both execution
and invocation:
Execution policies:
• Define what AWS resources/API calls can this
function access via IAM
• Used in streaming invocations
• E.g., “Lambda function A can read from DynamoDB
table users”
Function policies:
• Used for sync and async invocations
• E.g., “Actions on bucket X can invoke Lambda
function Z"
• Resource policies allow for cross-account access
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Let’s
https://secure.flickr.com/photos/stevendepolo/5749192025/!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon S3
bucket
object
Lambda
function
1. File put into bucket
2. Lambda invoked
Lambda
function
2. Lambda invoked
SNS
topic
1. Data published to a topic
Data
1. Lambda directly invoked
via invoke API
SDK clients
Lambda
function
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Message inserted into
to a queue
Message
Amazon
SQS
Lambda
function
3. Function
removes message
from queue
2. Lambda polls
queue and invokes
function
New New
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda
function
2. Lambda function
invoked
1. API call made against
API Gateway
API clients
Amazon API
Gateway
Lambda
function
Lambda
function
2. API call is made
directly against backing
AWS service
Amazon API
Gateway
API clients
Amazon
S3
Amazon
Kinesis
Amazon
DynamoDB
etc.
1. API call made against
API Gateway
Lambda
function
2. Lambda authorizer
function invoked
1. API call made against API
Gateway where API is
configured for a Lambda
Authorizer
API clients
Amazon API
Gateway
3. Lambda responds with results
and if successful API Gateway
proceeds with an API backend
call
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda
function
2. Lambda@Edge function
invoked
1. HTTP/S request made to
CloudFront-based domain
HTTPrequest
Amazon
CloudFront
Lambda
function
2+. Lambda
function(s) invoked
1. Step Functions workflow
is executed
Lambda
function
Lambda
function
AWS Step
Functions
Event
2. AWS Step Functions
workflow is executed
1. API call made against
API Gateway
Amazon API
Gateway
API clients
Step Functions
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda
function
2. Lambda invoked via rule
1. Error message gets sent
back to Amazon SES on
delivery attempt
Amazon
SES
Email failure
notification
Lambda
function
2. Lambda invoked per
matching trigger
1. User performs action
with trigger set
Amazon
Cognito
Users
Lambda
function
2. Lambda function
invoked
1. GraphQL call made
against AWS AppSync
GraphQL API
clients
AWS AppSync
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda
function
2. Lambda polls
stream
Amazon
KinesisData
Streams
1. Data published to a
stream
3. Kinesis returns
stream data
Data
Data
Amazon
KinesisData
Analytics
Lambda
function
SQLQuery
Amazon
KinesisData
Streams/
Firehose
Amazon
KinesisData
Streams/
Firehose
Lambda
function
1. Data published to a
stream
2. Stream passes to
Kinesis Data Analytics
3. Lambda invoked to
pre-process data
4. SQL query run on
processed data
5. Analytics output
sent back to
Streams/Firehose 6. Lambda invoked
per poll model to the
left
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda
function
1. Deployment event
is sent to SNS topic
AWS
CodeDeploy
Lambda
function
2. AWS CodePipeline executed
Application
code
1. Code committed
3. Lambda function
invoked via stage action
2. Lambda invoked via
SNS configuration
SNS topic
Lambda
function
3. Lambda invoked
Application
code
1. Code repository event
AWS
CodeCommit
2. Event trigger tripped
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
"AMIGetter": {
"Type": "Custom::AMIGetter",
"Properties": {
"ServiceToken": { "Fn::Join": [ "", [
"arn:aws:lambda:", { "Ref": "AWS::Region" },
":", { "Ref": "AWS::AccountId" }, ":function:",
"AMIGetter" ] ] },
….
Lambda
function
2. Lambda invoked
1. Custom resource
executed
AWS CloudFormation
template
Lambda
function
2. Amazon S3 publishes
event to Lambda
1. AWS API calls logged to
an object in
Amazon S3
AWS
CloudTrail
S3 bucket
3. Lambda invoked,
processes object in
Amazon S3
Lambda
function
2. Change sent to Amazon
SNS topic
1. AWS resource changed
AWS
Config
SNS topic
3. Lambda invoked
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda
function
2. Lambda invoked via rule
Changeevent
1. AWS resource changed or
periodic execution
Config rule
Lambda
function
2. Lambda invoked via rule
Serviceevent
1. Service event or CWE
Bus API call
Amazon CloudWatch
Events (event-based)
Lambda
function
1. Scheduled time
occurs
CloudWatch Events
(time-based)
2. Lambda invoked
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda
function
3. Lambda invoked
Metricdata
1. Metric data collected
by CloudWatch
CloudWatch
2. Alarm threshold
breached
Lambda
function
3. Lambda invoked
Logs
1. Logs collected by
Amazon CloudWatch
Logs
Amazon
CloudWatch
2. Logs passed on
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. items inserted,
updated, or deleted
Lambda
function
3. Lambda polls
stream
Amazon
Kinesis
Streams
4. Kinesis
returns stream
data
items
DynamoDB
table
2. Event published to
Amazon Kinesis Data
Streams
Lambda
function
3. Lambda invoked
1. Query executed
Amazon
Aurora - MySQL
SQLquery
2. Stored procedure
called
Lambda
function
3. Lambda invoked
1. Amazon Redshift
event occurs
Amazon
Redshift
SNS topic
2. Event sent to SNS topic
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2. Lambda invoked
1. Chatbot conversation
needs “fulfillment”
Lambda
function
Amazon
Lex
Chatbot
Lambda
function
2. Lambda invoked
1. Alexa, what’s today’s
weather?
Alexa skill
Alexa compatible
device
Lambda
function
2. Lambda invoked
1. IoT device sends data
IoT device
AWS IoT
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
FIN, ACK
• From full fledged application backends to “glue” functions
attached to operational tasks
• Removes the need to run hosts for small scripts such as cron
jobs and small web services, with many benefits:
• Reduced cost
• Reduced maintenance overhead
• No capacity planning needed for potential spikes in usage
• Security model that allows for finely scoped access and permissions
• Use AWS SAM to deploy
• Can get started right in the console or via AWS CodeStar
There are a lot of different use cases for Lambda
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
aws.amazon.com/serverless
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Submit session feedback
1. Tap the Schedule icon.
2. Select the session you attended.
3. Tap Session Evaluation to submit
your feedback.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!

Más contenido relacionado

La actualidad más candente

Deploying computer vision model as api using aws lambda and api gateway
Deploying computer vision model as api using aws lambda and api gatewayDeploying computer vision model as api using aws lambda and api gateway
Deploying computer vision model as api using aws lambda and api gateway
Shirish Gupta
 
Serverless architectures-with-aws-lambda
Serverless architectures-with-aws-lambdaServerless architectures-with-aws-lambda
Serverless architectures-with-aws-lambda
saifam
 

La actualidad más candente (20)

Declarative GraphQL: Adding GraphQL to our REST APIs without writing a single...
Declarative GraphQL: Adding GraphQL to our REST APIs without writing a single...Declarative GraphQL: Adding GraphQL to our REST APIs without writing a single...
Declarative GraphQL: Adding GraphQL to our REST APIs without writing a single...
 
Reply Labcamp Rome - AWS Zombie - Serverless and Microservices
Reply Labcamp Rome - AWS Zombie - Serverless and MicroservicesReply Labcamp Rome - AWS Zombie - Serverless and Microservices
Reply Labcamp Rome - AWS Zombie - Serverless and Microservices
 
Cloud Security-how to create serverless applications
Cloud Security-how to create serverless applicationsCloud Security-how to create serverless applications
Cloud Security-how to create serverless applications
 
AWS Lambda Powertools
AWS Lambda PowertoolsAWS Lambda Powertools
AWS Lambda Powertools
 
Itb 2021 - Bulding Quick APIs by Gavin Pickin
Itb 2021 - Bulding Quick APIs by Gavin PickinItb 2021 - Bulding Quick APIs by Gavin Pickin
Itb 2021 - Bulding Quick APIs by Gavin Pickin
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayBuild a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
 
Deploying computer vision model as api using aws lambda and api gateway
Deploying computer vision model as api using aws lambda and api gatewayDeploying computer vision model as api using aws lambda and api gateway
Deploying computer vision model as api using aws lambda and api gateway
 
AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018AWS API Gateway - AJUG August 2018
AWS API Gateway - AJUG August 2018
 
Serverless Design Patterns
Serverless Design PatternsServerless Design Patterns
Serverless Design Patterns
 
Serveless design patterns (VoxxedDays Luxembourg)
Serveless design patterns (VoxxedDays Luxembourg)Serveless design patterns (VoxxedDays Luxembourg)
Serveless design patterns (VoxxedDays Luxembourg)
 
Why GE Aviation Migrated from Cassandra to Amazon DynamoDB (DAT332) - AWS re:...
Why GE Aviation Migrated from Cassandra to Amazon DynamoDB (DAT332) - AWS re:...Why GE Aviation Migrated from Cassandra to Amazon DynamoDB (DAT332) - AWS re:...
Why GE Aviation Migrated from Cassandra to Amazon DynamoDB (DAT332) - AWS re:...
 
Amazon AI: soluzioni di intelligenza artificiale pronte per l'uso
Amazon AI: soluzioni di intelligenza artificiale pronte per l'usoAmazon AI: soluzioni di intelligenza artificiale pronte per l'uso
Amazon AI: soluzioni di intelligenza artificiale pronte per l'uso
 
Working with Relational Databases in AWS Glue ETL (ANT342) - AWS re:Invent 2018
Working with Relational Databases in AWS Glue ETL (ANT342) - AWS re:Invent 2018Working with Relational Databases in AWS Glue ETL (ANT342) - AWS re:Invent 2018
Working with Relational Databases in AWS Glue ETL (ANT342) - AWS re:Invent 2018
 
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
Migrating Your NoSQL Database to Amazon DynamoDB (DAT314) - AWS re:Invent 2018
 
Tracking and business intelligence
Tracking and business intelligenceTracking and business intelligence
Tracking and business intelligence
 
Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web DayLeveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
Leveraging the Security of AWS's Own APIs for Your App - AWS Serverless Web Day
 
Serverless architectures-with-aws-lambda
Serverless architectures-with-aws-lambdaServerless architectures-with-aws-lambda
Serverless architectures-with-aws-lambda
 
Build and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API GatewayBuild and Manage Your APIs with Amazon API Gateway
Build and Manage Your APIs with Amazon API Gateway
 
Building Your Geospatial Data Lake (WPS324) - AWS re:Invent 2018
Building Your Geospatial Data Lake (WPS324) - AWS re:Invent 2018Building Your Geospatial Data Lake (WPS324) - AWS re:Invent 2018
Building Your Geospatial Data Lake (WPS324) - AWS re:Invent 2018
 
AWS Lambda in infrastructure
AWS Lambda in infrastructureAWS Lambda in infrastructure
AWS Lambda in infrastructure
 

Similar a Thirty Serverless Architectures in 30 Minutes - SRV325 - Chicago AWS Summit

Serverless Architecture - Design Patterns and Best Practices
Serverless Architecture - Design Patterns and Best PracticesServerless Architecture - Design Patterns and Best Practices
Serverless Architecture - Design Patterns and Best Practices
Amazon Web Services
 

Similar a Thirty Serverless Architectures in 30 Minutes - SRV325 - Chicago AWS Summit (20)

Thirty serverless architectures in 30 minutes - MAD202 - Chicago AWS Summit
Thirty serverless architectures in 30 minutes - MAD202 - Chicago AWS SummitThirty serverless architectures in 30 minutes - MAD202 - Chicago AWS Summit
Thirty serverless architectures in 30 minutes - MAD202 - Chicago AWS Summit
 
Build Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS Summit
Build Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS SummitBuild Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS Summit
Build Enterprise-Grade Serverless Apps - SRV315 - Atlanta AWS Summit
 
Build Enterprise-Grade Serverless Apps
Build Enterprise-Grade Serverless Apps Build Enterprise-Grade Serverless Apps
Build Enterprise-Grade Serverless Apps
 
Serverless Architectural Patterns I AWS Dev Day 2018
Serverless Architectural Patterns I AWS Dev Day 2018Serverless Architectural Patterns I AWS Dev Day 2018
Serverless Architectural Patterns I AWS Dev Day 2018
 
SRV213-Thirty Serverless Architectures in 30 Minutes
SRV213-Thirty Serverless Architectures in 30 MinutesSRV213-Thirty Serverless Architectures in 30 Minutes
SRV213-Thirty Serverless Architectures in 30 Minutes
 
The Future of Enterprise Applications is Serverless
The Future of Enterprise Applications is ServerlessThe Future of Enterprise Applications is Serverless
The Future of Enterprise Applications is Serverless
 
Building Serverless Enterprise Applications - SRV315 - Anaheim AWS Summit
Building Serverless Enterprise Applications - SRV315 - Anaheim AWS SummitBuilding Serverless Enterprise Applications - SRV315 - Anaheim AWS Summit
Building Serverless Enterprise Applications - SRV315 - Anaheim AWS Summit
 
Building Serverless Applications with Amazon DynamoDB & AWS Lambda - Workshop...
Building Serverless Applications with Amazon DynamoDB & AWS Lambda - Workshop...Building Serverless Applications with Amazon DynamoDB & AWS Lambda - Workshop...
Building Serverless Applications with Amazon DynamoDB & AWS Lambda - Workshop...
 
Build Enterprise-Grade Serverless Apps - SRV315 - Chicago AWS Summit
Build Enterprise-Grade Serverless Apps - SRV315 - Chicago AWS SummitBuild Enterprise-Grade Serverless Apps - SRV315 - Chicago AWS Summit
Build Enterprise-Grade Serverless Apps - SRV315 - Chicago AWS Summit
 
Building serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS SummitBuilding serverless enterprise applications - SRV315 - Toronto AWS Summit
Building serverless enterprise applications - SRV315 - Toronto AWS Summit
 
SRV315 Building Enterprise-Grade Serverless Apps
 SRV315 Building Enterprise-Grade Serverless Apps SRV315 Building Enterprise-Grade Serverless Apps
SRV315 Building Enterprise-Grade Serverless Apps
 
Serverless computing - Build and run applications without thinking about servers
Serverless computing - Build and run applications without thinking about serversServerless computing - Build and run applications without thinking about servers
Serverless computing - Build and run applications without thinking about servers
 
Serverless Architectural Patterns - GOTO Amsterdam
Serverless Architectural Patterns - GOTO AmsterdamServerless Architectural Patterns - GOTO Amsterdam
Serverless Architectural Patterns - GOTO Amsterdam
 
Serverless Development Deep Dive
Serverless Development Deep DiveServerless Development Deep Dive
Serverless Development Deep Dive
 
Serverless Architecture - Design Patterns and Best Practices
Serverless Architecture - Design Patterns and Best PracticesServerless Architecture - Design Patterns and Best Practices
Serverless Architecture - Design Patterns and Best Practices
 
Serverless Architectural Patterns
Serverless Architectural PatternsServerless Architectural Patterns
Serverless Architectural Patterns
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Serverless Architectural Patterns - ServerlessDays TLV
Serverless Architectural Patterns - ServerlessDays TLVServerless Architectural Patterns - ServerlessDays TLV
Serverless Architectural Patterns - ServerlessDays TLV
 
Serverless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best PracticesServerless on AWS: Architectural Patterns and Best Practices
Serverless on AWS: Architectural Patterns and Best Practices
 
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
Build Modern Applications that Align with Twelve-Factor Methods (API303) - AW...
 

Más de Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Más de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
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
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Thirty Serverless Architectures in 30 Minutes - SRV325 - Chicago AWS Summit

  • 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Angela Wang – AWS Solutions Architect Thirty Serverless Architectures in 30 Minutes
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Angela Wang – AWS Solutions Architect Thirty Serverless Architectures in 30 MinutesX X
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. https://secure.flickr.com/photos/mgifford/4525333972 Why are we here today?
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. No servers to provision or manage Scales with usage Never pay for idle Availability and fault tolerance built in Serverless means …
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless applications Services (anything) Changes in data state Requests to endpoints Changes in resource state Event source Function Node.js Python Java C# Go
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Common use cases for AWS Lambda Web applications • Static websites • Complex web apps • Packages for Flask and Express Data processing • Real time • MapReduce • Batch Chatbots • Powering chatbot logic Backends • Apps & services • Mobile • IoT </></> Amazon Alexa • Powering voice-enabled apps • Alexa Skills Kit IT automation • Policy engines • Extending AWS services • Infrastructure management
  • 7. Lambda execution models Synchronous (push) Asynchronous (event) Poll-Based Amazon API Gateway Lambda function Amazon DynamoDBAmazon SNS /order Lambda function Amazon S3 reqs Amazon Kinesis changes Lambda service function
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda execution models Poll-based Amazon SQS Messages AWS Lambda service Lambda function New New
  • 9. Lambda permissions model Fine-grained security controls for both execution and invocation: Execution policies: • Define what AWS resources/API calls can this function access via IAM • Used in streaming invocations • E.g., “Lambda function A can read from DynamoDB table users” Function policies: • Used for sync and async invocations • E.g., “Actions on bucket X can invoke Lambda function Z" • Resource policies allow for cross-account access
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Let’s https://secure.flickr.com/photos/stevendepolo/5749192025/!
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon S3 bucket object Lambda function 1. File put into bucket 2. Lambda invoked Lambda function 2. Lambda invoked SNS topic 1. Data published to a topic Data 1. Lambda directly invoked via invoke API SDK clients Lambda function
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Message inserted into to a queue Message Amazon SQS Lambda function 3. Function removes message from queue 2. Lambda polls queue and invokes function New New
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda function 2. Lambda function invoked 1. API call made against API Gateway API clients Amazon API Gateway Lambda function Lambda function 2. API call is made directly against backing AWS service Amazon API Gateway API clients Amazon S3 Amazon Kinesis Amazon DynamoDB etc. 1. API call made against API Gateway Lambda function 2. Lambda authorizer function invoked 1. API call made against API Gateway where API is configured for a Lambda Authorizer API clients Amazon API Gateway 3. Lambda responds with results and if successful API Gateway proceeds with an API backend call
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda function 2. Lambda@Edge function invoked 1. HTTP/S request made to CloudFront-based domain HTTPrequest Amazon CloudFront Lambda function 2+. Lambda function(s) invoked 1. Step Functions workflow is executed Lambda function Lambda function AWS Step Functions Event 2. AWS Step Functions workflow is executed 1. API call made against API Gateway Amazon API Gateway API clients Step Functions
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda function 2. Lambda invoked via rule 1. Error message gets sent back to Amazon SES on delivery attempt Amazon SES Email failure notification Lambda function 2. Lambda invoked per matching trigger 1. User performs action with trigger set Amazon Cognito Users Lambda function 2. Lambda function invoked 1. GraphQL call made against AWS AppSync GraphQL API clients AWS AppSync
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda function 2. Lambda polls stream Amazon KinesisData Streams 1. Data published to a stream 3. Kinesis returns stream data Data Data Amazon KinesisData Analytics Lambda function SQLQuery Amazon KinesisData Streams/ Firehose Amazon KinesisData Streams/ Firehose Lambda function 1. Data published to a stream 2. Stream passes to Kinesis Data Analytics 3. Lambda invoked to pre-process data 4. SQL query run on processed data 5. Analytics output sent back to Streams/Firehose 6. Lambda invoked per poll model to the left
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda function 1. Deployment event is sent to SNS topic AWS CodeDeploy Lambda function 2. AWS CodePipeline executed Application code 1. Code committed 3. Lambda function invoked via stage action 2. Lambda invoked via SNS configuration SNS topic Lambda function 3. Lambda invoked Application code 1. Code repository event AWS CodeCommit 2. Event trigger tripped
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. "AMIGetter": { "Type": "Custom::AMIGetter", "Properties": { "ServiceToken": { "Fn::Join": [ "", [ "arn:aws:lambda:", { "Ref": "AWS::Region" }, ":", { "Ref": "AWS::AccountId" }, ":function:", "AMIGetter" ] ] }, …. Lambda function 2. Lambda invoked 1. Custom resource executed AWS CloudFormation template Lambda function 2. Amazon S3 publishes event to Lambda 1. AWS API calls logged to an object in Amazon S3 AWS CloudTrail S3 bucket 3. Lambda invoked, processes object in Amazon S3 Lambda function 2. Change sent to Amazon SNS topic 1. AWS resource changed AWS Config SNS topic 3. Lambda invoked
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda function 2. Lambda invoked via rule Changeevent 1. AWS resource changed or periodic execution Config rule Lambda function 2. Lambda invoked via rule Serviceevent 1. Service event or CWE Bus API call Amazon CloudWatch Events (event-based) Lambda function 1. Scheduled time occurs CloudWatch Events (time-based) 2. Lambda invoked
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda function 3. Lambda invoked Metricdata 1. Metric data collected by CloudWatch CloudWatch 2. Alarm threshold breached Lambda function 3. Lambda invoked Logs 1. Logs collected by Amazon CloudWatch Logs Amazon CloudWatch 2. Logs passed on
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. items inserted, updated, or deleted Lambda function 3. Lambda polls stream Amazon Kinesis Streams 4. Kinesis returns stream data items DynamoDB table 2. Event published to Amazon Kinesis Data Streams Lambda function 3. Lambda invoked 1. Query executed Amazon Aurora - MySQL SQLquery 2. Stored procedure called Lambda function 3. Lambda invoked 1. Amazon Redshift event occurs Amazon Redshift SNS topic 2. Event sent to SNS topic
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2. Lambda invoked 1. Chatbot conversation needs “fulfillment” Lambda function Amazon Lex Chatbot Lambda function 2. Lambda invoked 1. Alexa, what’s today’s weather? Alexa skill Alexa compatible device Lambda function 2. Lambda invoked 1. IoT device sends data IoT device AWS IoT
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. FIN, ACK • From full fledged application backends to “glue” functions attached to operational tasks • Removes the need to run hosts for small scripts such as cron jobs and small web services, with many benefits: • Reduced cost • Reduced maintenance overhead • No capacity planning needed for potential spikes in usage • Security model that allows for finely scoped access and permissions • Use AWS SAM to deploy • Can get started right in the console or via AWS CodeStar There are a lot of different use cases for Lambda
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. aws.amazon.com/serverless
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Submit session feedback 1. Tap the Schedule icon. 2. Select the session you attended. 3. Tap Session Evaluation to submit your feedback.
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you!