SlideShare a Scribd company logo
1 of 62
Download to read offline
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Thirty serverless architectures in
30 minutes
Chris Munns
Principal Developer Advocate, Serverless
Amazon Web Services
M A D 2 0 2
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
Thirty serverless architectures in
30 minutes
Chris Munns
Principal Developer Advocate, Serverless
Amazon Web Services
M A D 2 0 2
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is serverless?
No infrastructure provisioning,
no management
Automatic scaling
Pay for value Highly available and secure
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless applications
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless applications
Function
Node.js
Python
Java
C#
Go
Ruby
Runtime API
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless applications
Event source
Changes in
data state
Requests to
endpoints
Changes in
resource state
Function
Node.js
Python
Java
C#
Go
Ruby
Runtime API
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless applications
Event source Services
Changes in
data state
Requests to
endpoints
Changes in
resource state
Function
Node.js
Python
Java
C#
Go
Ruby
Runtime API
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Serverless applications
ServicesEvent source
Changes in
data state
Requests to
endpoints
Changes in
resource state
Function
Node.js
Python
Java
C#
Go
Ruby
Runtime API
Today, we’re
focusing here
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Common AWS Lambda use cases
Web apps Backends Data
processing
Chatbots Amazon Alexa IT automation
• Static
websites
• Complex
web apps
• Packages
for Flask
and
Express
• Apps &
services
• Mobile
• IoT
• Real time
• Amazon EMR
• AWS Batch
• Powering
chatbot logic
• Powering
voice-
enabled apps
• Alexa Skills
Kit
• Policy engines
• Extending AWS
services
• Infrastructure
management
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda execution model
Synchronous (push) Asynchronous
(event)
Stream
(poll-based)
Amazon
DynamoDB
Amazon
SNS
/order
Amazon
S3
reqs
Amazon
Kinesis
changes
AWS Lambda
service
Function
Amazon API
Gateway
Lambda
function
Lambda
function
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda API
1. Lambda directly invoked
via invoke API
SDK clients
API provided by the Lambda service
Used by all other services that invoke
Lambda across all models
Supports sync and async
Can pass any event payload structure
you want
Client included in every SDK
Lambda
function
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda permissions model
Fine-grained security controls for both execution
and invocation:
Execution policies:
• Define what AWS resources/API calls this function can
access via IAM
• Used in streaming invocations
• E.g., “Lambda function A can read from
Amazon 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
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon S3 + Lambda
Storage for the internet
Objects stored in a bucket (namespace)
Messages can be filtered and only sent to
certain paths, prefixes, or suffixes
Asynchronous
1. File put into bucket
2. Lambda invoked
Lambda
function
Amazon S3
Object
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SNS + Lambda
Simple, flexible, fully managed publish/subscribe
messaging and mobile push notification service for
high throughput, highly reliable message delivery
Messages are published to a topic
Topics can have multiple subscribers (fanout)
Messages can be filtered and only sent to certain
subscribers
Asynchronous
2. Lambda function(s) invoked
SNS topic
1. Data published to a topic
Data
Lambda
function
Lambda
function
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2. Lambda invoked via rule
Email failure
notification
1. Error message gets sent back
to Amazon SES on delivery
attempt
2. Lambda invoked per
matching trigger
1. User performs action
with trigger set
Users
2. Lambda function
invoked
1. GraphQL call made
against AWS AppSync
GraphQL API
clients
Lambda
function
Lambda
function Lambda
function
Amazon SES
Amazon Cognito AWS AppSync
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Message
inserted into to
a queue
Message
Amazon
SQS3. Amazon SQS
removes message
from queue on
successful
response from
function
2. Lambda function
invoked
Amazon SQS + Lambda
Simple, flexible, fully managed message
queuing service for reliably and
continuously exchanging any volume of
messages from anywhere
Processed in batches
At least once delivery
Visibility timeout allows for handling of
failures during processing
Asynchronous
Lambda
function
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2. Lambda
polls stream
1. Data published to a
stream
3. Kinesis returns
stream data
Data
Amazon Kinesis Streams + Lambda
Fully managed, highly scalable service for
collecting and processing real-time data
streams for analytics and machine learning
Stream consists of shards with a fixed amount
of capacity and throughput
Lambda receives batches and potentially
batches of batches
Can have different applications consuming
the same stream
Stream
Lambda
function
Amazon
Kinesis
Stream
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Data
SQLquery
1. Data published to a
stream
2. Stream passes to
Amazon Kinesis Data
Analytics
3. Lambda invoked to
pre-process data
4. SQL query run on
processed data
5. Analytics output sent
back to Amazon Kinesis
Data Stream or Kinesis
Data Firehose
6. Lambda invoked per
poll model to the left
Lambda
function
Lambda
function
Amazon Kinesis
Data Firehose
Kinesis Data
Firehose
Amazon
Kinesis Data
Analytics
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Items Inserted/
Updated/ Deleted
3. Lambda polls
stream
4. Kinesis
returns stream
data
2. Event published to
Kinesis Stream
3. Lambda invoked
1. Query executed
SQLQuery
2. Stored
procedure called
3. Lambda invoked
1. Amazon Redshift
Event occurs
2. Event sent to SNS topic
Lambda
function
Lambda
function
Lambda
function
Amazon
Kinesis Data
Streams
Amazon Redshift
Amazon Aurora
- MySQL
SNS topic
Items
DynamoDB
Table
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2. AWS CodePipeline executed
Application
code
1. Code committed
3. Lambda function invoked
via stage action
Lambda
function
AWS CodeDeploy
1. Deployment event is
sent to SNS topic
2. Lambda invoked via
Amazon SNS
configuration
Lambda
function
SNS topic
3. Lambda invoked
Application
Code
1. Code repository event
2. Event trigger tripped
Lambda
function
AWS CodeCommit
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2. Amazon S3 publishes
event to Lambda
1. AWS API calls logged to an
object in Amazon S3
3. Lambda invoked,
processes object in
Amazon S3
Lambda
function
2. Change sent to SNS topic
1. AWS resource changed
3. Lambda invoked
Lambda
function
SNS topic
2. Lambda invoked via rule
Changeevent
1. AWS resource changed or
periodic execution
AWS
Config rule
Lambda
function
S3 bucket
AWS CloudTrail AWS Config
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 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" ] ] },
….
2. Lambda invoked
1. Custom resource
executed
Lambda function
AWS CloudFormation
2. Lambda invoked
SecretRotation
Event
1. Secret rotation happens
Lambda
function
AWS Secrets Manager
AWS Systems Manager
1. AWS Systems Manager
event or status
notification sent
2. Lambda invoked via
Amazon SNS
configuration
Lambda
function
SNS topic
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1. Scheduled time
occurs
CloudWatch Events
(time-based)
2. Lambda invoked
Lambda
function
2. Lambda invoked via rule
Serviceevent
1. Service Event or CWE
Bus API call
Amazon
CloudWatch Events
(event-based)
Lambda
function
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
3. Lambda invoked
Metricdata
1. Metric data collected by
CloudWatch
Amazon
CloudWatch
2. Alarm threshold
breached
3. Lambda invoked
Logs
1. Logs collected by
CloudWatch Logs
2. Logs passed on
Lambda
function
Lambda
function
Amazon CloudWatch
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2. Lambda invoked
1. Chatbot conversation
needs “fulfillment”
Chatbot
2. Lambda invoked
1. Alexa, what’s today’s
weather?
Alexa skill
Alexa compatible
device
Lambda
function
Lambda
function
Amazon Lex
2. Lambda invoked
1. IoT device sends data
Lambda
function
AWS IoT
services
IoT device
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
API architecture
Websites
Services
Amazon API Gateway
API Gateway
cache
Public
endpoints on
Amazon EC2
Amazon
CloudWatch
monitoring
All publicly accessible
endpoints
Lambda
functions
Endpoints
in VPC
Applications
& services
in VPC
Any other AWS
service
Fully managed
CloudFront
distribution
Edge-optimizedRegionalPrivate
Applications
& Services
in the same
AWS Region AWS Direct
Connect
On premises
HTTPS
Mobile client
Customer managed
CloudFront distribution
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Types of APIs available
Amazon API Gateway
API Gateway
cache
Amazon
CloudWatch
monitoring
Fully managed
CloudFront
distribution
Edge-optimizedRegionalPrivate
Edge-optimized
• Utilizes CloudFront to reduce
TLS connection overhead
(reduces roundtrip time)
• Designed for a globally
distributed set of clients
Regional
• Recommended API type
for general use cases
• Designed for building APIs
for clients in the same
Region
Private
• Only accessible from within VPC
(and networks connected to
VPC)
• Designed for building APIs used
internally or by private
microservices
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The coming wave of serverless web applications
API Gateway handles all your
application routing, including
authentication and authorization,
throttling, DDoS protection, and
more
Lambda runs all the logic behind your
website and interfaces with databases,
other backend services, or anything
else your site needs
Amazon S3 stores all of your static
content: CSS, JS, images, and more.
You would typically front this with a
CDN, such as CloudFront
Amazon S3
Amazon API Gateway AWS LambdaAmazon CloudFront
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2. Lambda function
invoked
1. API call made against
API Gateway
API clients
2. API call made directly
against backing AWS service
API clients
etc.
1. API call made against
API Gateway
1. API call made against API
Gateway where API is configured
for a Lambda Authorizer
API clients
3. Lambda responds with results
and if successful API Gateway
proceeds with API backend call
Lambda
function
2. Lambda authorizer
function invoked
Lambda
function
Lambda
function
Lambda
function
Amazon API Gateway Amazon API Gateway Amazon API Gateway
Amazon S3 KinesisData
Streams
Amazon
DynamoDB
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2+. Lambda function(s)
invoked
1. Step Functions workflow is
executed
Event
Lambda
function
Lambda
function
Lambda
function
2. AWS Step Functions
workflow is executed
1. API call made against API
Gateway
API clients
Amazon API Gateway
Step Functions
AWS Step Functions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Track status of data
and execution
Remove redundant
code
Build workflows to orchestrate everything
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Simpler integration, less code
With serverless polling With new service integrationStart
End
AWS
Lambda
functions
Start
End
No
Lambda
functions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Step Functions: Integrations
Simplify building workloads such as order processing,
report generation, and data analysis
Write and maintain less code; add services in minutes
More service integrations:
AWS Step
Functions
Amazon SNS Amazon SQS Amazon
SageMaker
AWS Glue AWS Batch Amazon ECS AWS Fargate
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
2. Lambda@Edge function
invoked in nearest Region
1. HTTP/S request made to
Amazon CloudFront-based
domain
HTTPrequest
Lambda
function
Amazon CloudFront
2. Lambda function invoked
to serve HTTP response
1. HTTP/S request made
to Application Load
Balancer
HTTPrequest
Lambda
function
Application Load Balancer
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Meet
AWS
SAM!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Serverless Application Model (AWS SAM)
AWS CloudFormation extension optimized for serverless
Special serverless resource types: functions, APIs, tables,
Layers, and Applications
Supports anything AWS CloudFormation supports
Open specification (Apache 2.0)
https://aws.amazon.com/serverless/sam
AWS SAM template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
GetHtmlFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://sam-demo-bucket/todo_list.zip
Handler: index.gethtml
Runtime: nodejs8.10
Policies: AmazonDynamoDBReadOnlyAccess
Events:
GetHtml:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
ListTable:
Type: AWS::Serverless::SimpleTable
AWS SAM template
Tells AWS CloudFormation this is an AWS
SAM template it needs to “transform”
Creates a Lambda function with the
referenced managed AWS IAM policy,
runtime, code at the referenced zip
location, and handler as defined
Also creates an Amazon API Gateway and
takes care of all mapping/permissions
necessary
Creates an Amazon DynamoDB table with
five read & write units
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
GetHtmlFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://sam-demo-bucket/todo_list.zip
Handler: index.gethtml
Runtime: nodejs8.10
Policies: AmazonDynamoDBReadOnlyAccess
Events:
GetHtml:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
ListTable:
Type: AWS::Serverless::SimpleTable
https://github.com/awslabs/aws-serverless-samfarm/blob/master/api/saml.yaml
This
becomes this →
AWS SAM template
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS SAM policy templates
MyQueueFunction:
Type: AWS::Serverless::Function
Properties:
...
Policies:
# Gives permissions to poll an SQS Queue
- SQSPollerPolicy:
queueName: !Ref MyQueue
...
MyQueue:
Type: AWS::SQS::Queue
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
SAM Policy Templates
50+ predefined policies
All found here:
https://bit.ly/2xWycnj
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Globals:
Function:
Runtime: nodejs6.10
CodeUri: s3://code-artifacts/pet_app1234.zip
MemorySize: 1024
Timeout: 30
AutoPublishAlias: !Ref ENVIRONMENT
getDogsFunction:
Type: AWS::Serverless::Function
Properties:
Handler: getdogs.handler
Events:
GetDogs:
Type: Api
Properties:
Path: /Dogs
Method: ANY
getCatsFunction:
Type: AWS::Serverless::Function
Properties:
Handler: getCats.handler
Events:
GetCats:
Type: Api
Properties:
Path: /Cats
Method: ANY
getBirdsFunction:
Type: AWS::Serverless::Function
Properties:
Handler: getBirds.handler
Timeout: 15
Events:
GetBirds:
Type: Api
Properties:
Path: /Birds
Method: ANY
AWS SAM globals
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS SAM CLI
CLI tool for local development, debugging, testing, deploying, and
monitoring of serverless applications
Supports API Gateway “proxy-style” and Lambda service API
testing
Response object and function logs available on your local machine
Uses open-source Docker-Lambda images to mimic Lambda’s
execution environment such as timeout, memory limits, runtimes
Can tail production logs from Amazon CloudWatch Logs
Can help you build in native dependencies
https://aws.amazon.com/serverless/sam
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
With the AWS Serverless Application Repository
Developers can …
• Discover and deploy ready-made apps and code
examples
• Combine applications in the app repository with their
own via nested applications
• Customize open-source apps to get started quickly
• Share apps privately or publish apps
for public use
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Launched via AWS
Serverless Application
Repository
Parent relationship
”Nested” serverless
application stack
”Root” serverless
application stack
”Nested” serverless
application stack
”Nested” serverless
application stack
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Metrics and logging are a universal right
CloudWatch metrics:
• Seven built-in metrics for Lambda
• Invocation count, invocation duration, invocation
errors, throttled invocation, iterator age, DLQ
errors, concurrency
• Can call “put-metric-data” from your function code
for custom metrics
• Seven built-in metrics for Amazon API Gateway
• API calls count, latency, 4XXs, 5XXs, integration latency, cache hit
count, cache miss count
• Error and cache metrics support averages and percentiles
Metrics and logging are a universal right
CloudWatch Logs:
• API Gateway Logging
• 2 Levels of logging, ERROR and INFO
• Optionally log method request/body content
• Set globally in stage, or override per method
• Lambda logging
• Logging directly from your code with your language’s
equivalent of console.log()
• Basic request information included
• Log pivots
• Build metrics based on log filters
• Jump to logs that generated metrics
• Export logs to Amazon ElastiCache or Amazon S3
• Explore with Kibana, Amazon Athena, or Amazon QuickSight
Metrics and logging are a universal right!
CloudWatch Logs:
• API Gateway Logging
• 2 Levels of logging, ERROR and INFO
• Optionally log method request/body content
• Set globally in stage, or override per method
• Lambda Logging
• Logging directly from your code with your language’s
equivalent of console.log()
• Basic request information included
• Log Pivots
• Build metrics based on log filters
• Jump to logs that generated metrics
• Export logs to Amazon ElastiCache or Amazon S3
• Explore with Kibana, Amazon Athena, or Amazon QuickSight
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS X-Ray
Profile and troubleshoot serverless
applications:
• Lambda instruments incoming
requests for all supported languages
and can capture calls made in code
• API Gateway inserts a tracing header
into HTTP calls and reports data back
to X-Ray itself
var AWSXRay = require(‘aws-xray-sdk-core‘);
var AWS = AWSXRay.captureAWS(require(‘aws-sdk’));
S3Client = AWS.S3();
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
X-Ray trace example
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How do I determine what’s wrong?
These tools are here, so use them
1. Turn on X-Ray now
1. look at wrapping your own calls with it via the X-Ray SDKs
2. Don’t underestimate the power of logging in Lambda
1. Simple “debug: in functionX” statements work great and are easy
to find in Amazon CloudWatch Logs
3. The most valuable metrics are the ones closest to your
customer/use-case
1. How many gizmos did this function call, create, process, etc.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T
© 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 (serverless application models) to deploy!
You may not even need to write a function!
There are many different use cases for serverless
aws.amazon.com/serverless/sam
aws.amazon.com/serverless
Thank you!
S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Chris Munns
munns@amazon.com
@chrismunns

More Related Content

What's hot

Progetta, crea e gestisci Modern Application per web e mobile su AWS
Progetta, crea e gestisci Modern Application per web e mobile su AWSProgetta, crea e gestisci Modern Application per web e mobile su AWS
Progetta, crea e gestisci Modern Application per web e mobile su AWSAmazon Web Services
 
Increasing the value of video with machine learning & AWS Media Services - SV...
Increasing the value of video with machine learning & AWS Media Services - SV...Increasing the value of video with machine learning & AWS Media Services - SV...
Increasing the value of video with machine learning & AWS Media Services - SV...Amazon Web Services
 
Security and governance with AWS Control Tower and AWS Organizations - SEC204...
Security and governance with AWS Control Tower and AWS Organizations - SEC204...Security and governance with AWS Control Tower and AWS Organizations - SEC204...
Security and governance with AWS Control Tower and AWS Organizations - SEC204...Amazon Web Services
 
Creare e gestire Data Lake e Data Warehouses
Creare e gestire Data Lake e Data WarehousesCreare e gestire Data Lake e Data Warehouses
Creare e gestire Data Lake e Data WarehousesAmazon Web Services
 
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...Amazon Web Services
 
Adding intelligence to applications - AIM201 - Chicago AWS Summit
Adding intelligence to applications - AIM201 - Chicago AWS SummitAdding intelligence to applications - AIM201 - Chicago AWS Summit
Adding intelligence to applications - AIM201 - Chicago AWS SummitAmazon Web Services
 
Unleash the Power of ML with AWS | AWS Summit Tel Aviv 2019
Unleash the Power of ML with AWS | AWS Summit Tel Aviv 2019Unleash the Power of ML with AWS | AWS Summit Tel Aviv 2019
Unleash the Power of ML with AWS | AWS Summit Tel Aviv 2019AWS Summits
 
Building with AWS Databases: Match Your Workload to the Right Database | AWS ...
Building with AWS Databases: Match Your Workload to the Right Database | AWS ...Building with AWS Databases: Match Your Workload to the Right Database | AWS ...
Building with AWS Databases: Match Your Workload to the Right Database | AWS ...AWS Summits
 
What's new in Amazon Aurora - ADB203 - Atlanta AWS Summit
What's new in Amazon Aurora - ADB203 - Atlanta AWS SummitWhat's new in Amazon Aurora - ADB203 - Atlanta AWS Summit
What's new in Amazon Aurora - ADB203 - Atlanta AWS SummitAmazon Web Services
 
What's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdf
What's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdfWhat's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdf
What's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdfAmazon Web Services
 
How Millennium Management achieves provable security with AWS Zelkova - FSV30...
How Millennium Management achieves provable security with AWS Zelkova - FSV30...How Millennium Management achieves provable security with AWS Zelkova - FSV30...
How Millennium Management achieves provable security with AWS Zelkova - FSV30...Amazon Web Services
 
ML for every developer and data scientist with Amazon SageMaker - AIM201 - At...
ML for every developer and data scientist with Amazon SageMaker - AIM201 - At...ML for every developer and data scientist with Amazon SageMaker - AIM201 - At...
ML for every developer and data scientist with Amazon SageMaker - AIM201 - At...Amazon Web Services
 
Using automation to drive continuous-compliance best practices - SVC309 - Chi...
Using automation to drive continuous-compliance best practices - SVC309 - Chi...Using automation to drive continuous-compliance best practices - SVC309 - Chi...
Using automation to drive continuous-compliance best practices - SVC309 - Chi...Amazon Web Services
 
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019AWS Summits
 
What’s new with Amazon Redshift, featuring ZS Associates - ADB205 - Chicago A...
What’s new with Amazon Redshift, featuring ZS Associates - ADB205 - Chicago A...What’s new with Amazon Redshift, featuring ZS Associates - ADB205 - Chicago A...
What’s new with Amazon Redshift, featuring ZS Associates - ADB205 - Chicago A...Amazon Web Services
 
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...Amazon Web Services
 
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...Amazon Web Services
 
Add intelligence to applications - AIM205 - Santa Clara AWS Summit.pdf
Add intelligence to applications - AIM205 - Santa Clara AWS Summit.pdfAdd intelligence to applications - AIM205 - Santa Clara AWS Summit.pdf
Add intelligence to applications - AIM205 - Santa Clara AWS Summit.pdfAmazon Web Services
 
Deep-Dive-with-Cloud-Monitoring-with-Amazon-EKS-and-Prometheus
Deep-Dive-with-Cloud-Monitoring-with-Amazon-EKS-and-PrometheusDeep-Dive-with-Cloud-Monitoring-with-Amazon-EKS-and-Prometheus
Deep-Dive-with-Cloud-Monitoring-with-Amazon-EKS-and-PrometheusAmazon Web Services
 
Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...
Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...
Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...Amazon Web Services
 

What's hot (20)

Progetta, crea e gestisci Modern Application per web e mobile su AWS
Progetta, crea e gestisci Modern Application per web e mobile su AWSProgetta, crea e gestisci Modern Application per web e mobile su AWS
Progetta, crea e gestisci Modern Application per web e mobile su AWS
 
Increasing the value of video with machine learning & AWS Media Services - SV...
Increasing the value of video with machine learning & AWS Media Services - SV...Increasing the value of video with machine learning & AWS Media Services - SV...
Increasing the value of video with machine learning & AWS Media Services - SV...
 
Security and governance with AWS Control Tower and AWS Organizations - SEC204...
Security and governance with AWS Control Tower and AWS Organizations - SEC204...Security and governance with AWS Control Tower and AWS Organizations - SEC204...
Security and governance with AWS Control Tower and AWS Organizations - SEC204...
 
Creare e gestire Data Lake e Data Warehouses
Creare e gestire Data Lake e Data WarehousesCreare e gestire Data Lake e Data Warehouses
Creare e gestire Data Lake e Data Warehouses
 
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
Favorire l'innovazione passando da applicazioni monolitiche ad architetture m...
 
Adding intelligence to applications - AIM201 - Chicago AWS Summit
Adding intelligence to applications - AIM201 - Chicago AWS SummitAdding intelligence to applications - AIM201 - Chicago AWS Summit
Adding intelligence to applications - AIM201 - Chicago AWS Summit
 
Unleash the Power of ML with AWS | AWS Summit Tel Aviv 2019
Unleash the Power of ML with AWS | AWS Summit Tel Aviv 2019Unleash the Power of ML with AWS | AWS Summit Tel Aviv 2019
Unleash the Power of ML with AWS | AWS Summit Tel Aviv 2019
 
Building with AWS Databases: Match Your Workload to the Right Database | AWS ...
Building with AWS Databases: Match Your Workload to the Right Database | AWS ...Building with AWS Databases: Match Your Workload to the Right Database | AWS ...
Building with AWS Databases: Match Your Workload to the Right Database | AWS ...
 
What's new in Amazon Aurora - ADB203 - Atlanta AWS Summit
What's new in Amazon Aurora - ADB203 - Atlanta AWS SummitWhat's new in Amazon Aurora - ADB203 - Atlanta AWS Summit
What's new in Amazon Aurora - ADB203 - Atlanta AWS Summit
 
What's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdf
What's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdfWhat's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdf
What's new in Amazon Aurora - ADB204 - Santa Clara AWS Summit.pdf
 
How Millennium Management achieves provable security with AWS Zelkova - FSV30...
How Millennium Management achieves provable security with AWS Zelkova - FSV30...How Millennium Management achieves provable security with AWS Zelkova - FSV30...
How Millennium Management achieves provable security with AWS Zelkova - FSV30...
 
ML for every developer and data scientist with Amazon SageMaker - AIM201 - At...
ML for every developer and data scientist with Amazon SageMaker - AIM201 - At...ML for every developer and data scientist with Amazon SageMaker - AIM201 - At...
ML for every developer and data scientist with Amazon SageMaker - AIM201 - At...
 
Using automation to drive continuous-compliance best practices - SVC309 - Chi...
Using automation to drive continuous-compliance best practices - SVC309 - Chi...Using automation to drive continuous-compliance best practices - SVC309 - Chi...
Using automation to drive continuous-compliance best practices - SVC309 - Chi...
 
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019 Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
Let Your Business Logic go Serverless | AWS Summit Tel Aviv 2019
 
What’s new with Amazon Redshift, featuring ZS Associates - ADB205 - Chicago A...
What’s new with Amazon Redshift, featuring ZS Associates - ADB205 - Chicago A...What’s new with Amazon Redshift, featuring ZS Associates - ADB205 - Chicago A...
What’s new with Amazon Redshift, featuring ZS Associates - ADB205 - Chicago A...
 
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...
Get hands-on with AWS DeepRacer and compete in the AWS DeepRacer League - AIM...
 
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
Build intelligent applications quickly with AWS AI services - AIM301 - New Yo...
 
Add intelligence to applications - AIM205 - Santa Clara AWS Summit.pdf
Add intelligence to applications - AIM205 - Santa Clara AWS Summit.pdfAdd intelligence to applications - AIM205 - Santa Clara AWS Summit.pdf
Add intelligence to applications - AIM205 - Santa Clara AWS Summit.pdf
 
Deep-Dive-with-Cloud-Monitoring-with-Amazon-EKS-and-Prometheus
Deep-Dive-with-Cloud-Monitoring-with-Amazon-EKS-and-PrometheusDeep-Dive-with-Cloud-Monitoring-with-Amazon-EKS-and-Prometheus
Deep-Dive-with-Cloud-Monitoring-with-Amazon-EKS-and-Prometheus
 
Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...
Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...
Amazon SageMaker: ML for Every Developer and Data Scientist - AIM202 - Anahei...
 

Similar to Thirty serverless architectures in 30 minutes - MAD202 - Chicago AWS Summit

Thirty Serverless Architectures in 30 Minutes - SRV325 - Chicago AWS Summit
Thirty Serverless Architectures in 30 Minutes - SRV325 - Chicago AWS SummitThirty Serverless Architectures in 30 Minutes - SRV325 - Chicago AWS Summit
Thirty Serverless Architectures in 30 Minutes - SRV325 - Chicago AWS SummitAmazon Web Services
 
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 SummitAmazon Web Services
 
Build Enterprise-Grade Serverless Apps
Build Enterprise-Grade Serverless Apps Build Enterprise-Grade Serverless Apps
Build Enterprise-Grade Serverless Apps Amazon Web Services
 
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
 
Thinking Asynchronously Full Vesion - Utah UG
Thinking Asynchronously Full Vesion - Utah UGThinking Asynchronously Full Vesion - Utah UG
Thinking Asynchronously Full Vesion - Utah UGEric Johnson
 
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019 Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019 Eric Johnson
 
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 2018AWS Germany
 
Scalable serverless architectures using event-driven design - MAD310 - Chicag...
Scalable serverless architectures using event-driven design - MAD310 - Chicag...Scalable serverless architectures using event-driven design - MAD310 - Chicag...
Scalable serverless architectures using event-driven design - MAD310 - Chicag...Amazon Web Services
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesAWS Summits
 
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019Amazon Web Services
 
Best practices for queue processing in serverless applications - MAD313 - Chi...
Best practices for queue processing in serverless applications - MAD313 - Chi...Best practices for queue processing in serverless applications - MAD313 - Chi...
Best practices for queue processing in serverless applications - MAD313 - Chi...Amazon Web Services
 
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 SummitAmazon Web Services
 
Serverless workshop with Amazon Web Services
Serverless workshop with Amazon Web ServicesServerless workshop with Amazon Web Services
Serverless workshop with Amazon Web ServicesTheFamily
 
The family - presentation on AWS Serverless
The family - presentation on AWS ServerlessThe family - presentation on AWS Serverless
The family - presentation on AWS ServerlessAlexandre Pinhel
 
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 SummitAmazon Web Services
 
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 SummitAmazon Web Services
 
Serverless applications with AWS
Serverless applications with AWSServerless applications with AWS
Serverless applications with AWSjavier ramirez
 
Scalable serverless architectures using event-driven design - MAD308 - New Yo...
Scalable serverless architectures using event-driven design - MAD308 - New Yo...Scalable serverless architectures using event-driven design - MAD308 - New Yo...
Scalable serverless architectures using event-driven design - MAD308 - New Yo...Amazon Web Services
 
How to build scalable and resilient applications in the cloud - AWS Summit Ca...
How to build scalable and resilient applications in the cloud - AWS Summit Ca...How to build scalable and resilient applications in the cloud - AWS Summit Ca...
How to build scalable and resilient applications in the cloud - AWS Summit Ca...Amazon Web Services
 

Similar to Thirty serverless architectures in 30 minutes - MAD202 - Chicago AWS Summit (20)

Thirty Serverless Architectures in 30 Minutes - SRV325 - Chicago AWS Summit
Thirty Serverless Architectures in 30 Minutes - SRV325 - Chicago AWS SummitThirty Serverless Architectures in 30 Minutes - SRV325 - Chicago AWS Summit
Thirty Serverless Architectures in 30 Minutes - SRV325 - 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
 
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 ...
 
Thinking Asynchronously Full Vesion - Utah UG
Thinking Asynchronously Full Vesion - Utah UGThinking Asynchronously Full Vesion - Utah UG
Thinking Asynchronously Full Vesion - Utah UG
 
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019 Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019
Thinking Asynchronously - ServerlessDays Istanbul - Oct 3 2019
 
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
 
Scalable serverless architectures using event-driven design - MAD310 - Chicag...
Scalable serverless architectures using event-driven design - MAD310 - Chicag...Scalable serverless architectures using event-driven design - MAD310 - Chicag...
Scalable serverless architectures using event-driven design - MAD310 - Chicag...
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019
Building a fully serverless application on AWS | AWS Summit Tel Aviv 2019
 
Best practices for queue processing in serverless applications - MAD313 - Chi...
Best practices for queue processing in serverless applications - MAD313 - Chi...Best practices for queue processing in serverless applications - MAD313 - Chi...
Best practices for queue processing in serverless applications - MAD313 - Chi...
 
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
 
Serverless workshop with Amazon Web Services
Serverless workshop with Amazon Web ServicesServerless workshop with Amazon Web Services
Serverless workshop with Amazon Web Services
 
The family - presentation on AWS Serverless
The family - presentation on AWS ServerlessThe family - presentation on AWS Serverless
The family - presentation on AWS Serverless
 
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
 
Serverless applications with AWS
Serverless applications with AWSServerless applications with AWS
Serverless applications with AWS
 
Scalable serverless architectures using event-driven design - MAD308 - New Yo...
Scalable serverless architectures using event-driven design - MAD308 - New Yo...Scalable serverless architectures using event-driven design - MAD308 - New Yo...
Scalable serverless architectures using event-driven design - MAD308 - New Yo...
 
How to build scalable and resilient applications in the cloud - AWS Summit Ca...
How to build scalable and resilient applications in the cloud - AWS Summit Ca...How to build scalable and resilient applications in the cloud - AWS Summit Ca...
How to build scalable and resilient applications in the cloud - AWS Summit Ca...
 

More from Amazon Web Services

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...Amazon Web Services
 
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...Amazon Web Services
 
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 FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
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 Amazon Web Services
 
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...Amazon Web Services
 
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...Amazon Web Services
 
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 WorkloadsAmazon Web Services
 
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 sfatareAmazon Web Services
 
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 NodeJSAmazon Web Services
 
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
 
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 sfatareAmazon 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 AWSAmazon 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 DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon 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
 
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
 

More from 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 - MAD202 - Chicago AWS Summit

  • 1. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Thirty serverless architectures in 30 minutes Chris Munns Principal Developer Advocate, Serverless Amazon Web Services M A D 2 0 2
  • 2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T Thirty serverless architectures in 30 minutes Chris Munns Principal Developer Advocate, Serverless Amazon Web Services M A D 2 0 2
  • 3. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is serverless? No infrastructure provisioning, no management Automatic scaling Pay for value Highly available and secure
  • 5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless applications
  • 6. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless applications Function Node.js Python Java C# Go Ruby Runtime API
  • 7. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless applications Event source Changes in data state Requests to endpoints Changes in resource state Function Node.js Python Java C# Go Ruby Runtime API
  • 8. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless applications Event source Services Changes in data state Requests to endpoints Changes in resource state Function Node.js Python Java C# Go Ruby Runtime API
  • 9. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Serverless applications ServicesEvent source Changes in data state Requests to endpoints Changes in resource state Function Node.js Python Java C# Go Ruby Runtime API Today, we’re focusing here
  • 10. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Common AWS Lambda use cases Web apps Backends Data processing Chatbots Amazon Alexa IT automation • Static websites • Complex web apps • Packages for Flask and Express • Apps & services • Mobile • IoT • Real time • Amazon EMR • AWS Batch • Powering chatbot logic • Powering voice- enabled apps • Alexa Skills Kit • Policy engines • Extending AWS services • Infrastructure management
  • 11. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda execution model Synchronous (push) Asynchronous (event) Stream (poll-based) Amazon DynamoDB Amazon SNS /order Amazon S3 reqs Amazon Kinesis changes AWS Lambda service Function Amazon API Gateway Lambda function Lambda function
  • 12. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda API 1. Lambda directly invoked via invoke API SDK clients API provided by the Lambda service Used by all other services that invoke Lambda across all models Supports sync and async Can pass any event payload structure you want Client included in every SDK Lambda function
  • 13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda permissions model Fine-grained security controls for both execution and invocation: Execution policies: • Define what AWS resources/API calls this function can access via IAM • Used in streaming invocations • E.g., “Lambda function A can read from Amazon 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
  • 14. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 15. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon S3 + Lambda Storage for the internet Objects stored in a bucket (namespace) Messages can be filtered and only sent to certain paths, prefixes, or suffixes Asynchronous 1. File put into bucket 2. Lambda invoked Lambda function Amazon S3 Object
  • 16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon SNS + Lambda Simple, flexible, fully managed publish/subscribe messaging and mobile push notification service for high throughput, highly reliable message delivery Messages are published to a topic Topics can have multiple subscribers (fanout) Messages can be filtered and only sent to certain subscribers Asynchronous 2. Lambda function(s) invoked SNS topic 1. Data published to a topic Data Lambda function Lambda function
  • 17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2. Lambda invoked via rule Email failure notification 1. Error message gets sent back to Amazon SES on delivery attempt 2. Lambda invoked per matching trigger 1. User performs action with trigger set Users 2. Lambda function invoked 1. GraphQL call made against AWS AppSync GraphQL API clients Lambda function Lambda function Lambda function Amazon SES Amazon Cognito AWS AppSync
  • 18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Message inserted into to a queue Message Amazon SQS3. Amazon SQS removes message from queue on successful response from function 2. Lambda function invoked Amazon SQS + Lambda Simple, flexible, fully managed message queuing service for reliably and continuously exchanging any volume of messages from anywhere Processed in batches At least once delivery Visibility timeout allows for handling of failures during processing Asynchronous Lambda function
  • 19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2. Lambda polls stream 1. Data published to a stream 3. Kinesis returns stream data Data Amazon Kinesis Streams + Lambda Fully managed, highly scalable service for collecting and processing real-time data streams for analytics and machine learning Stream consists of shards with a fixed amount of capacity and throughput Lambda receives batches and potentially batches of batches Can have different applications consuming the same stream Stream Lambda function Amazon Kinesis Stream
  • 20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Data SQLquery 1. Data published to a stream 2. Stream passes to Amazon Kinesis Data Analytics 3. Lambda invoked to pre-process data 4. SQL query run on processed data 5. Analytics output sent back to Amazon Kinesis Data Stream or Kinesis Data Firehose 6. Lambda invoked per poll model to the left Lambda function Lambda function Amazon Kinesis Data Firehose Kinesis Data Firehose Amazon Kinesis Data Analytics
  • 21. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Items Inserted/ Updated/ Deleted 3. Lambda polls stream 4. Kinesis returns stream data 2. Event published to Kinesis Stream 3. Lambda invoked 1. Query executed SQLQuery 2. Stored procedure called 3. Lambda invoked 1. Amazon Redshift Event occurs 2. Event sent to SNS topic Lambda function Lambda function Lambda function Amazon Kinesis Data Streams Amazon Redshift Amazon Aurora - MySQL SNS topic Items DynamoDB Table
  • 22. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2. AWS CodePipeline executed Application code 1. Code committed 3. Lambda function invoked via stage action Lambda function AWS CodeDeploy 1. Deployment event is sent to SNS topic 2. Lambda invoked via Amazon SNS configuration Lambda function SNS topic 3. Lambda invoked Application Code 1. Code repository event 2. Event trigger tripped Lambda function AWS CodeCommit
  • 23. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2. Amazon S3 publishes event to Lambda 1. AWS API calls logged to an object in Amazon S3 3. Lambda invoked, processes object in Amazon S3 Lambda function 2. Change sent to SNS topic 1. AWS resource changed 3. Lambda invoked Lambda function SNS topic 2. Lambda invoked via rule Changeevent 1. AWS resource changed or periodic execution AWS Config rule Lambda function S3 bucket AWS CloudTrail AWS Config
  • 24. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 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" ] ] }, …. 2. Lambda invoked 1. Custom resource executed Lambda function AWS CloudFormation 2. Lambda invoked SecretRotation Event 1. Secret rotation happens Lambda function AWS Secrets Manager AWS Systems Manager 1. AWS Systems Manager event or status notification sent 2. Lambda invoked via Amazon SNS configuration Lambda function SNS topic
  • 25. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1. Scheduled time occurs CloudWatch Events (time-based) 2. Lambda invoked Lambda function 2. Lambda invoked via rule Serviceevent 1. Service Event or CWE Bus API call Amazon CloudWatch Events (event-based) Lambda function
  • 26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 3. Lambda invoked Metricdata 1. Metric data collected by CloudWatch Amazon CloudWatch 2. Alarm threshold breached 3. Lambda invoked Logs 1. Logs collected by CloudWatch Logs 2. Logs passed on Lambda function Lambda function Amazon CloudWatch
  • 27. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2. Lambda invoked 1. Chatbot conversation needs “fulfillment” Chatbot 2. Lambda invoked 1. Alexa, what’s today’s weather? Alexa skill Alexa compatible device Lambda function Lambda function Amazon Lex 2. Lambda invoked 1. IoT device sends data Lambda function AWS IoT services IoT device
  • 28. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. API architecture Websites Services Amazon API Gateway API Gateway cache Public endpoints on Amazon EC2 Amazon CloudWatch monitoring All publicly accessible endpoints Lambda functions Endpoints in VPC Applications & services in VPC Any other AWS service Fully managed CloudFront distribution Edge-optimizedRegionalPrivate Applications & Services in the same AWS Region AWS Direct Connect On premises HTTPS Mobile client Customer managed CloudFront distribution
  • 29. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Types of APIs available Amazon API Gateway API Gateway cache Amazon CloudWatch monitoring Fully managed CloudFront distribution Edge-optimizedRegionalPrivate Edge-optimized • Utilizes CloudFront to reduce TLS connection overhead (reduces roundtrip time) • Designed for a globally distributed set of clients Regional • Recommended API type for general use cases • Designed for building APIs for clients in the same Region Private • Only accessible from within VPC (and networks connected to VPC) • Designed for building APIs used internally or by private microservices
  • 30. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The coming wave of serverless web applications API Gateway handles all your application routing, including authentication and authorization, throttling, DDoS protection, and more Lambda runs all the logic behind your website and interfaces with databases, other backend services, or anything else your site needs Amazon S3 stores all of your static content: CSS, JS, images, and more. You would typically front this with a CDN, such as CloudFront Amazon S3 Amazon API Gateway AWS LambdaAmazon CloudFront
  • 31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2. Lambda function invoked 1. API call made against API Gateway API clients 2. API call made directly against backing AWS service API clients etc. 1. API call made against API Gateway 1. API call made against API Gateway where API is configured for a Lambda Authorizer API clients 3. Lambda responds with results and if successful API Gateway proceeds with API backend call Lambda function 2. Lambda authorizer function invoked Lambda function Lambda function Lambda function Amazon API Gateway Amazon API Gateway Amazon API Gateway Amazon S3 KinesisData Streams Amazon DynamoDB
  • 32. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2+. Lambda function(s) invoked 1. Step Functions workflow is executed Event Lambda function Lambda function Lambda function 2. AWS Step Functions workflow is executed 1. API call made against API Gateway API clients Amazon API Gateway Step Functions AWS Step Functions
  • 33. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Track status of data and execution Remove redundant code Build workflows to orchestrate everything
  • 34. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Simpler integration, less code With serverless polling With new service integrationStart End AWS Lambda functions Start End No Lambda functions
  • 35. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Step Functions: Integrations Simplify building workloads such as order processing, report generation, and data analysis Write and maintain less code; add services in minutes More service integrations: AWS Step Functions Amazon SNS Amazon SQS Amazon SageMaker AWS Glue AWS Batch Amazon ECS AWS Fargate
  • 36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 2. Lambda@Edge function invoked in nearest Region 1. HTTP/S request made to Amazon CloudFront-based domain HTTPrequest Lambda function Amazon CloudFront 2. Lambda function invoked to serve HTTP response 1. HTTP/S request made to Application Load Balancer HTTPrequest Lambda function Application Load Balancer
  • 37. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 39. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Serverless Application Model (AWS SAM) AWS CloudFormation extension optimized for serverless Special serverless resource types: functions, APIs, tables, Layers, and Applications Supports anything AWS CloudFormation supports Open specification (Apache 2.0) https://aws.amazon.com/serverless/sam
  • 40. AWS SAM template AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: GetHtmlFunction: Type: AWS::Serverless::Function Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.gethtml Runtime: nodejs8.10 Policies: AmazonDynamoDBReadOnlyAccess Events: GetHtml: Type: Api Properties: Path: /{proxy+} Method: ANY ListTable: Type: AWS::Serverless::SimpleTable
  • 41. AWS SAM template Tells AWS CloudFormation this is an AWS SAM template it needs to “transform” Creates a Lambda function with the referenced managed AWS IAM policy, runtime, code at the referenced zip location, and handler as defined Also creates an Amazon API Gateway and takes care of all mapping/permissions necessary Creates an Amazon DynamoDB table with five read & write units AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: GetHtmlFunction: Type: AWS::Serverless::Function Properties: CodeUri: s3://sam-demo-bucket/todo_list.zip Handler: index.gethtml Runtime: nodejs8.10 Policies: AmazonDynamoDBReadOnlyAccess Events: GetHtml: Type: Api Properties: Path: /{proxy+} Method: ANY ListTable: Type: AWS::Serverless::SimpleTable
  • 43. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SAM policy templates MyQueueFunction: Type: AWS::Serverless::Function Properties: ... Policies: # Gives permissions to poll an SQS Queue - SQSPollerPolicy: queueName: !Ref MyQueue ... MyQueue: Type: AWS::SQS::Queue
  • 44. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. SAM Policy Templates 50+ predefined policies All found here: https://bit.ly/2xWycnj
  • 45. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Globals: Function: Runtime: nodejs6.10 CodeUri: s3://code-artifacts/pet_app1234.zip MemorySize: 1024 Timeout: 30 AutoPublishAlias: !Ref ENVIRONMENT getDogsFunction: Type: AWS::Serverless::Function Properties: Handler: getdogs.handler Events: GetDogs: Type: Api Properties: Path: /Dogs Method: ANY getCatsFunction: Type: AWS::Serverless::Function Properties: Handler: getCats.handler Events: GetCats: Type: Api Properties: Path: /Cats Method: ANY getBirdsFunction: Type: AWS::Serverless::Function Properties: Handler: getBirds.handler Timeout: 15 Events: GetBirds: Type: Api Properties: Path: /Birds Method: ANY AWS SAM globals
  • 46. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS SAM CLI CLI tool for local development, debugging, testing, deploying, and monitoring of serverless applications Supports API Gateway “proxy-style” and Lambda service API testing Response object and function logs available on your local machine Uses open-source Docker-Lambda images to mimic Lambda’s execution environment such as timeout, memory limits, runtimes Can tail production logs from Amazon CloudWatch Logs Can help you build in native dependencies https://aws.amazon.com/serverless/sam
  • 47. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 48. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. With the AWS Serverless Application Repository Developers can … • Discover and deploy ready-made apps and code examples • Combine applications in the app repository with their own via nested applications • Customize open-source apps to get started quickly • Share apps privately or publish apps for public use
  • 49. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Launched via AWS Serverless Application Repository Parent relationship ”Nested” serverless application stack ”Root” serverless application stack ”Nested” serverless application stack ”Nested” serverless application stack
  • 50. S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 51. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Metrics and logging are a universal right CloudWatch metrics: • Seven built-in metrics for Lambda • Invocation count, invocation duration, invocation errors, throttled invocation, iterator age, DLQ errors, concurrency • Can call “put-metric-data” from your function code for custom metrics • Seven built-in metrics for Amazon API Gateway • API calls count, latency, 4XXs, 5XXs, integration latency, cache hit count, cache miss count • Error and cache metrics support averages and percentiles
  • 52.
  • 53. Metrics and logging are a universal right CloudWatch Logs: • API Gateway Logging • 2 Levels of logging, ERROR and INFO • Optionally log method request/body content • Set globally in stage, or override per method • Lambda logging • Logging directly from your code with your language’s equivalent of console.log() • Basic request information included • Log pivots • Build metrics based on log filters • Jump to logs that generated metrics • Export logs to Amazon ElastiCache or Amazon S3 • Explore with Kibana, Amazon Athena, or Amazon QuickSight
  • 54. Metrics and logging are a universal right! CloudWatch Logs: • API Gateway Logging • 2 Levels of logging, ERROR and INFO • Optionally log method request/body content • Set globally in stage, or override per method • Lambda Logging • Logging directly from your code with your language’s equivalent of console.log() • Basic request information included • Log Pivots • Build metrics based on log filters • Jump to logs that generated metrics • Export logs to Amazon ElastiCache or Amazon S3 • Explore with Kibana, Amazon Athena, or Amazon QuickSight
  • 55. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 56. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS X-Ray Profile and troubleshoot serverless applications: • Lambda instruments incoming requests for all supported languages and can capture calls made in code • API Gateway inserts a tracing header into HTTP calls and reports data back to X-Ray itself var AWSXRay = require(‘aws-xray-sdk-core‘); var AWS = AWSXRay.captureAWS(require(‘aws-sdk’)); S3Client = AWS.S3();
  • 57. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. X-Ray trace example
  • 58. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How do I determine what’s wrong? These tools are here, so use them 1. Turn on X-Ray now 1. look at wrapping your own calls with it via the X-Ray SDKs 2. Don’t underestimate the power of logging in Lambda 1. Simple “debug: in functionX” statements work great and are easy to find in Amazon CloudWatch Logs 3. The most valuable metrics are the ones closest to your customer/use-case 1. How many gizmos did this function call, create, process, etc.
  • 59. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.S U M M I T © 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 (serverless application models) to deploy! You may not even need to write a function! There are many different use cases for serverless
  • 62. Thank you! S U M M I T © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved. Chris Munns munns@amazon.com @chrismunns