SlideShare a Scribd company logo
P U B L I C S E C T O R
S U M M I T
Washington, DC
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
12 Factor Serverless
Applications
Eric Johnson
Senior Developer Advocate - Serverless
AWS
3 1 1 0 2 3
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Who Am I?
• @edjgeek
• Sr. Developer Advocate – Serverless, AWS
• Serverless/Tooling/Automation Geek
• Dad of five
• Husband of one
• Musician Drummer
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
The “12 Factor” model & serverless applications
• 12 Factor applications were popularized by developers building large scale
applications on platforms such as Heroku
• In recent years the 12 Factor guidelines have been considered best practices for
both developers and operations engineers regardless of the application’s use-case
and at nearly any scale
• Many of the 12 Factor guidelines align directly with best practices for serverless
applications and are improved upon given the nature of AWS Lambda, Amazon API
Gateway, and other AWS services
• However, some of the 12 Factor guidelines don’t directly align with serverless
applications or are interpreted very differently
From 12factor.net
From 12factor.net
From 12factor.net
From 12factor.net
From 12factor.net
From 12factor.net
From 12factor.net
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Serverless applications
Event source Function Services
Changes in
data state
Requests to
endpoints
Changes in
Resource state
Node.js
Python
Java
C#
Go
Ruby
Runtime API
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Common Lambda Use Cases
Amazon API Gateway Amazon
S3
Amazon SNS
Amazon
SQS
Amazon
Kinesis
Amazon
CloudWatch
Web or Mobile
Backend
File Processing Queue Processing
Notification ProcessingReal-Time Stream
Processing
Schedule Jobs
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
The 12 factors
Let’s explore how the 12 Factors apply to a serverless application:
1. Codebase
2. Dependencies
3. Config
4. Backing services
5. Build, release, run
6. Process
7. Port Binding
8. Concurrency
9. Disposability
10.Dev/prod parity
11.Logs
12.Admin processes
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
1. Codebase
12Factor.net: “One codebase tracked in revision control, many deploys”
Serverless Apps: All code should be stored in revision control (a
development best practice). The same repository should be used for all
environments deployed to. The bounds of an “application” differ in
serverless terms:
• If events are shared (ie. a common Amazon API Gateway) then
Lambda function code for those events should be put in the same
repository
• Otherwise break “services” along event source into their own
repositories
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
2. Dependencies
12Factor.net: “Explicitly declare and isolate dependencies”
Serverless Apps: Code that needs to be used by multiple functions should
be packaged into its own library. Place those packages inside of your
deployment package or into a AWS Lambda Layer.
Node.js, Python, Ruby
• .zip file consisting of
your code and any
dependencies
• Use npm/pip to install
libraries
• All dependencies
must be at root level
Java
• Either .zip file with all
code/dependencies,
or standalone .jar
• Use Maven / Eclipse
IDE plugins
• Compiled class &
resource files at root
level, required jars in
/lib directory
C# (.NET Core)
• Either .zip file with all
code / dependencies,
or a standalone .dll
• Use NuGet /
VisualStudio plugins
• All assemblies (.dll) at
root level
Go
• .zip file consisting of
your Go binary and
any dependencies
• Use “go get” to install
dependencies
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Lambda Layers
Lets functions easily share code: Upload layer
once, reference within any function
Layer can be anything: dependencies, training
data, configuration files, etc.
Promote separation of responsibilities, lets
developers iterate faster on writing business
logic
Built in support for secure sharing by ecosystem
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Using Lambda Layers
• Put common components in a ZIP file and
upload it as a Lambda Layer
• Layers are immutable and can be versioned to
manage updates
• When a version is deleted or permissions to use
it are revoked, functions that used it previously
will continue to work, but you won’t be able to
create new ones
• You can reference up to five layers, one of which
can optionally be a custom runtime
Lambda
Layers
arn:aws:lambda:region:accountId:layer:shared-lib :1
Lambda
Layers
arn:aws:lambda:region:accountId:layer:shared-lib:2
Lambda
Layers
arn:aws:lambda:region:accountId:layer:shared-lib:3
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
3. Config
12Factor.net: “Store config in the environment”
Serverless Apps: Many ways to do this in serverless applications:
• Lambda Environment Variables:
• Key-value pairs available via standard environment variable APIs such as
process.env for Node.js or os.environ for Python
• Support KMS encryption
• API Gateway Stages:
• Key-value pairs available for configuring API Gateway functionality or to pass on to
HTTP endpoints as URI parameters or configuration parameters to a Lambda
invocation
• AWS Systems Manager Parameter Store:
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
AWS Systems Manager – Parameter Store
Centralized store to manage your
configuration data
• supports hierarchies
• plain-text or encrypted with KMS
• Can send notifications of changes to Amazon
SNS/ AWS Lambda
• Can be secured with IAM
• Calls recorded in AWS CloudTrail
• Can be tagged
• Integrated with AWS Secrets Manager
• Available via API/SDK
Useful for: centralized environment
variables, secrets control, feature flags
from __future__ import print_function
import json, boto3
ssm = boto3.client('ssm', 'us-east-1')
def get_parameters():
response = ssm.get_parameters(
Names=['LambdaSecureString'],WithDe
cryption=True
)
for parameter in
response['Parameters']:
return parameter['Value']
def lambda_handler(event, context):
value = get_parameters()
print("value1 = " + value)
return value # Echo back the first key
value
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
4. Backing services
12Factor.net: “Treat backing services as attached resources”
Serverless Apps: No differences. Resources that AWS Lambda
functions connect to, such as databases, should have their endpoints
and access credentials made available via config resources or IAM
policies
👍
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
5. Build, release, run
12Factor.net: “Strictly separate build and run stages”
Serverless Apps: No differences. Development best practices such as
Continuous Integration and Continuous Delivery should be followed.
• Use AWS CodeBuild and AWS CodePipeline to support this:
AWS CodePipelineAWS CodeBuild
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
buildspec.yml Example
version: 0.1
environment_variables:
plaintext:
"INPUT_FILE": "saml.yaml”
"S3_BUCKET": ""
phases:
install:
commands:
- npm install
pre_build:
commands:
- eslint *.js
build:
commands:
- npm test
post_build:
commands:
- aws cloudformation package --template $INPUT_FILE --s3-bucket
$S3_BUCKET --output-template post-saml.yaml
artifacts:
type: zip
files:
- post-saml.yaml
- beta.json
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
buildspec.yml Example
• Variables to be used by phases of build
• Examples for what you can do in the phases
of a build:
• You can install packages or run
commands to prepare your
environment in ”install”.
• Run syntax checking, commands in
“pre_build”.
• Execute your build tool/command in
“build”
• Test your app further or ship a
container image to a repository in
post_build
• Create and store an artifact in S3
version: 0.1
environment_variables:
plaintext:
"INPUT_FILE": "saml.yaml”
"S3_BUCKET": ""
phases:
install:
commands:
- npm install
pre_build:
commands:
- eslint *.js
build:
commands:
- npm test
post_build:
commands:
- aws cloudformation package --template $INPUT_FILE --s3-bucket
$S3_BUCKET --output-template post-saml.yaml
artifacts:
type: zip
files:
- post-saml.yaml
- beta.json
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
An example minimal Developer’s pipeline:
MyBranch-Source
Source
CodeCommit
Build
test-build-source
CodeBuild
This pipeline:
• Three Stages
• Builds code artifact
• One Development environment
• Uses SAM/CloudFormation to deploy
artifact and other AWS resources
• Has Lambda custom actions for
running my own testing functions
MyDev-Deploy
create-changeset
AWS CloudFormation
execute-changeset
AWS CloudFormation
Run-stubs
AWS Lambda
MyApplication
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
An example minimal production pipeline:
This pipeline:
• Five Stages
• Builds code artifact
• Three deployed to “Environments”
• Uses SAM/CloudFormation to deploy
artifact and other AWS resources
• Has Lambda custom actions for running
my own testing functions
• Integrates with a 3rd party service
• Has a manual approval before
deploying to production
Source
Source
CodeCommit
MyApplication
Build
test-build-source
CodeBuild
Deploy Testing
create-changeset
AWS CloudFormation
execute-changeset
AWS CloudFormation
Run-stubs
AWS Lambda
Deploy Staging
create-changeset
AWS CloudFormation
execute-changeset
AWS CloudFormation
Run-API-test
Runscope
QA-Sign-off
Manual Approval
Review
Deploy Prod
create-changeset
AWS CloudFormation
execute-changeset
AWS CloudFormation
Post-Deploy-Slack
AWS Lambda
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
6. Process
12Factor.net: “Execute the app as one or more stateless processes”
Serverless Apps: This is inherent in how Lambda is designed already:
• Lambda Functions should be treated as stateless despite the potential to
store some state in-between execution environment re-use.
• There is no promise of execution environment re-use between function
invocations.
• Data that needs to be kept should be stored off Lambda in a stateful
service such as a database or cache.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
7. Port Binding
12Factor.net: “Export services via port binding”
Serverless Apps: In Lambda/serverless applications this factor doesn’t
apply the same due to a difference in how Lambda Functions are accessed:
• Instead of a “port” Lambda functions are invoked via one or more
triggering services or AWS’s APIs for Lambda
• When it comes to Lambda functions there are 3 models for how they can
be invoked; synchronously, asynchronously, and poll-based
• Instead of having one function support multiple invocation sources,
create independent functions
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
AWS Lambda API
1. Lambda directly invoked
via invoke API
SDK clients
Lambda
function
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
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Lambda execution model
Synchronous (push)
Amazon
API Gateway
AWS Lambda
function
/order
Asynchronous
(event)
Amazon
SNS
AWS Lambda
function
Amazon
S3
reqs
Poll-based
Amazon
DynamoDB
Amazon
Kinesis
changes
AWS Lambda
service
function
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
8. Concurrency
12Factor.net: “Scale out via the process model”
Serverless Apps: Doesn’t apply as Lambda functions will scale
automatically based on load. You can fork threads inside of your function
execution but there are practical limits due to the memory and CPU/network
constraints of your functions based on how you configure them.
👍
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Tweak your function’s computer power
Lambda exposes only a memory control, with the % of CPU core and
network capacity allocated to a function proportionally
Is your code CPU, Network or memory-bound? If so, it could be
cheaper to choose more memory.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Smart resource allocation
Match resource allocation (up to 3 GB!) to logic
Stats for Lambda function that calculates 1,000 times all prime numbers
<= 1,000,000
128 MB 11.722965sec $0.024628
256 MB 6.678945sec $0.028035
512 MB 3.194954sec $0.026830
1024 MB 1.465984sec $0.024638
Green==Best Red==Worst
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Smart resource allocation
Match resource allocation (up to 3 GB!) to logic
Stats for Lambda function that calculates 1,000 times all prime numbers
<= 1,000,000
128 MB 11.722965sec $0.024628
256 MB 6.678945sec $0.028035
512 MB 3.194954sec $0.026830
1024 MB 1.465984sec $0.024638
Green==Best Red==Worst
-10.25698sec +$0.00001
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
9. Disposability
12Factor.net: “Maximize robustness with fast startup and graceful
shutdown”
Serverless Apps: Shutdown doesn’t apply as Lambda functions and their
invocation are tied directly to incoming events. Speed at startup does
matter though and is a factor of deployment package size + language used
+ VPC (or not) + pre-handler code calls.
👍
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
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 as well as
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.P U B L I C S E C TO R
S U M M I T
X-Ray Trace Example
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
10. Dev/prod parity
12Factor.net: “Keep development, staging, and production as similar as
possible”
Serverless Apps: This can be made incredibly easy with serverless
applications by:
• Making use of environment/stage variables or Parameter Store for
configuration information, backend resources, etc
• Using Serverless Application Models (SAM) to deploy your application
• Can pass environment/stage variables via Parameters, Mappings,
Imports
• Having a CI/CD process and tooling that supports multiple environments
or accounts
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Meet
SAM!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
AWS Serverless Application Model (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
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
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: nodejs6.10
Policies: AmazonDynamoDBReadOnlyAccess
Events:
GetHtml:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
ListTable:
Type: AWS::Serverless::SimpleTable
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
AWS SAM Template
Tells AWS CloudFormation this is a
SAM template it needs to “transform”
Creates a AWS 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 a Amazon DynamoDB table
with 5 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: nodejs6.10
Policies: AmazonDynamoDBReadOnlyAccess
Events:
GetHtml:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
ListTable:
Type: AWS::Serverless::SimpleTable
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
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.P U B L I C S E C TO R
S U M M I T
AWS SAM Command Line Interface (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 AWS 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.P U B L I C S E C TO R
S U M M I T
11. Logs
12Factor.net: “Treat logs as event streams”
Serverless Apps: Logging (as well as Metric collection) are considered a
“universal right” in Lambda:
• Console output automatically collected and sent to Amazon CloudWatch
Logs
• Logs can be turned into Metrics
• Logs can be sent to Amazon S3 or Amazon ElasticSearch Service easily
for further inspection and trending
• Metrics for Lambda and API Gateway for several key stats are
automatically collected and sent to CloudWatch
• You can easily send more using the CloudWatch SDK
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
12. Admin processes
12Factor.net: “Run admin/management tasks as one-off processes”
Serverless Apps: Doesn’t apply to Lambda since you already limit your
functions based on use case. True administrative tasks would occur via
their own Lambda Functions or via tools such as Amazon EC2 Run
Command.
👍
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
The 12 Factors & Serverless Applications:
As we’ve seen, 12 Factor application design can still be applied to
serverless applications taking into account some small differences!
= Works similarly = Not relevant
1. Codebase 5. Build, release, run 9. Disposability
2. Dependencies 6. Process 10. Dev/prod parity
3. Config 7. Port Binding 11. Logs
4. Backing services 8. Concurrency 12. Admin processes
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
“
Pinpoint Moves Production Times from
Weeks to Minutes with AWS Lambda
Pinpoint needed to simplify—both their
internal workflow and analytics
processing pipeline, as well as the
process for building microservices
across their various teams and
products.
Pinpoint switched from using
Kubernetes to AWS Lambda to rewrite
their entire API tier, internal workflow,
and analytics processing pipeline.
• Deploys fixes and features multiple
times a day
• Simplifies internal workflow and
analytics processing
• Scales the adoption of
microservices across teams and
products
SolutionChallenge Benefits
Company: Pinpoint
Industry: Software Data Science
Country: United States
Website: www.pinpoint.com
”
“
- Jeff Haynie, Co-founder and CEO at Pinpoint
We can have a commit roll into production…in literally
minutes, as well as provide a bunch of flexible routing
options dynamically.
Pinpoint provides actionable insights for
software executives. By applying data
science to unearth how organizations
really work, Pinpoint helps leaders
advance the way people and teams
deliver software.
About Pinpoint
“
Autodesk Saves 99% with AWS Lambda,
Amazon DynamoDB & Amazon API Gateway
Setting up accounts was a
bottleneck for Autodesk’s two-
person team. The account creation
process was manual with static
configurations, and making any
changes or updates required a team
member to sign into hundreds of
accounts, one at a time, resulting in
two-week turnarounds.
Autodesk built “Tailor,” a solution using
Amazon DynamoDB for data
persistence and Amazon API Gateway
for API endpoints, and automated all
processes using AWS Lambda.
Autodesk developers now submit an
online form to request a new account
and an API request triggers the
account-creation process.
• Saves 99% of previous costs
• Supports queries by account
number, email address, or IP
address
• Saves up to one month of
development time
SolutionChallenge Benefits
Company: Autodesk
Industry: Software products for
Entertainment,
Architecture, Construction,
Engineering, Manufacturing
& Media Industries
Country: United States
Website: www.autodesk.com
Autodesk offers software products
aimed at the architecture, construction,
engineering, manufacturing, media and
entertainment industries.
Headquartered in California, Autodesk
has 10,000 employees in offices around
the world.
“ Prior to implementing Tailor, our cost to provision each
account was about $500 in employee time. It’s just shy
of $6 per account (now), which means we can create
about 10 times as many accounts for the same cost.
- Alan Williams, Enterprise Architect at Autodesk
About Autodesk
“
FINRA Doubles Cost Efficiency with AWS
Lambda
Data is ingested into Amazon S3 via
FTP and AWS Lambda performs the
validations. Amazon EC2 manages
data feeds coming into, and notifications
going out of, AWS Lambda. Amazon
SQS is used for input /output messaging
notifications while Amazon VPC
partitions the system into separate test
and production accounts.
• Delivered solution in three months
• Accelerated data validation by
700%
• Increased cost efficiency by a factor
of two
SolutionChallenge Benefits
Company: FINRA
Industry: Financial Regulatory Non-
Profit
Country: United States
Website: www.finra.org
The Financial Industry Regulatory
Authority (FINRA) is a not-for-profit
organization which protects investors
and ensures market integrity through
effective regulation of 3,800 broker-
dealers. They write and enforce rules,
examine firms for compliance, foster
market transparency, and educate
investors.
“ Using AWS Lambda, we’ve increased cost efficiency
by a factor of two. We only pay for what we use, and
we don’t have to manage on-premises server
infrastructure.”
- Tim Greisback, Senior Director of Technology, FINRA
About FINRA
FINRA validates the data of 50,000
broker-dealer OATS (Order Audit
Trail System) files and formats them
according to 200 rules, which totals
half a trillion validations each day.
FINRA needed a solution that could
scale with processing demand,
which can double or triple in
response to market conditions.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
FIN, ACK (in closing)
As we’ve reviewed the 12 Factor methodology for applications we’ve
seen which factors do and do not apply the same for serverless
applications:
• Thinking about code reusability and how to scope your functions to
the smallest size necessary provides many benefits
• Factors related to underlying process management, network ports,
concurrency, and admin processes are largely not an issue in
serverless applications due to Lambda’s product design and
features
• Best practices for serverless align pretty closely with 12 Factor
guidance already, so you might be really close to meeting the “12
Factor” bar already!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
aws.amazon.com/serverless/sam
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
aws.amazon.com/serverless
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Thank you!
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R
S U M M I T
Eric Johnson
@edjgeek

More Related Content

What's hot

Simplifying Microsoft Architectures with AWS Services (WIN306) - AWS re:Inven...
Simplifying Microsoft Architectures with AWS Services (WIN306) - AWS re:Inven...Simplifying Microsoft Architectures with AWS Services (WIN306) - AWS re:Inven...
Simplifying Microsoft Architectures with AWS Services (WIN306) - AWS re:Inven...
Amazon Web Services
 
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS SummitAutomatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Amazon Web Services
 
20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...
Marcia Villalba
 
Costruisci e distribuisci applicazioni web moderne con AWS Amplify Console
Costruisci e distribuisci applicazioni web moderne con AWS Amplify ConsoleCostruisci e distribuisci applicazioni web moderne con AWS Amplify Console
Costruisci e distribuisci applicazioni web moderne con AWS Amplify Console
Amazon Web Services
 
Serverless is dead.
Serverless is dead.Serverless is dead.
Serverless is dead.
Chris Munns
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and Fargate
Amazon Web Services
 
AWS 如何協助客戶建立 DevOps 流程
AWS 如何協助客戶建立 DevOps 流程AWS 如何協助客戶建立 DevOps 流程
AWS 如何協助客戶建立 DevOps 流程
Amazon Web Services
 
Networking Best Practices for Your Serverless Applications
Networking Best Practices for Your Serverless ApplicationsNetworking Best Practices for Your Serverless Applications
Networking Best Practices for Your Serverless Applications
Chris Munns
 
[AWS Container Service] Getting Started with Cloud Map, App Mesh and Firecracker
[AWS Container Service] Getting Started with Cloud Map, App Mesh and Firecracker[AWS Container Service] Getting Started with Cloud Map, App Mesh and Firecracker
[AWS Container Service] Getting Started with Cloud Map, App Mesh and Firecracker
Amazon Web Services Korea
 
muCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless ApplicationsmuCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless Applications
Chris Munns
 
Deep Dive into Amazon Fargate
Deep Dive into Amazon FargateDeep Dive into Amazon Fargate
Deep Dive into Amazon Fargate
Amazon Web Services
 
Deep Dive on Amazon Managed Blockchain
Deep Dive on Amazon Managed BlockchainDeep Dive on Amazon Managed Blockchain
Deep Dive on Amazon Managed Blockchain
Amazon Web Services
 
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
Chris Munns
 
Automatically scaling your Kubernetes workloads - SVC210-S - Santa Clara AWS ...
Automatically scaling your Kubernetes workloads - SVC210-S - Santa Clara AWS ...Automatically scaling your Kubernetes workloads - SVC210-S - Santa Clara AWS ...
Automatically scaling your Kubernetes workloads - SVC210-S - Santa Clara AWS ...
Amazon Web Services
 
EKS Workshop
 EKS Workshop EKS Workshop
EKS Workshop
AWS Germany
 
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 BarcelonaAWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
Amazon Web Services
 
Best Practices for AWS PrivateLink (NET301) - AWS re:Invent 2018
Best Practices for AWS PrivateLink (NET301) - AWS re:Invent 2018Best Practices for AWS PrivateLink (NET301) - AWS re:Invent 2018
Best Practices for AWS PrivateLink (NET301) - AWS re:Invent 2018
Amazon Web Services
 
20210608 - Desarrollo de aplicaciones en la nube
20210608 - Desarrollo de aplicaciones en la nube20210608 - Desarrollo de aplicaciones en la nube
20210608 - Desarrollo de aplicaciones en la nube
Marcia Villalba
 
Introduction to Amazon EKS
Introduction to Amazon EKSIntroduction to Amazon EKS
Introduction to Amazon EKS
Amazon Web Services
 
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
AWS Summits
 

What's hot (20)

Simplifying Microsoft Architectures with AWS Services (WIN306) - AWS re:Inven...
Simplifying Microsoft Architectures with AWS Services (WIN306) - AWS re:Inven...Simplifying Microsoft Architectures with AWS Services (WIN306) - AWS re:Inven...
Simplifying Microsoft Architectures with AWS Services (WIN306) - AWS re:Inven...
 
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS SummitAutomatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
Automatically Scaling Your Kubernetes Workloads - SVC209-S - Anaheim AWS Summit
 
20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...20201013 - Serverless Architecture Conference - How to migrate your existing ...
20201013 - Serverless Architecture Conference - How to migrate your existing ...
 
Costruisci e distribuisci applicazioni web moderne con AWS Amplify Console
Costruisci e distribuisci applicazioni web moderne con AWS Amplify ConsoleCostruisci e distribuisci applicazioni web moderne con AWS Amplify Console
Costruisci e distribuisci applicazioni web moderne con AWS Amplify Console
 
Serverless is dead.
Serverless is dead.Serverless is dead.
Serverless is dead.
 
CI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and FargateCI/CD with AWS Developer Tools and Fargate
CI/CD with AWS Developer Tools and Fargate
 
AWS 如何協助客戶建立 DevOps 流程
AWS 如何協助客戶建立 DevOps 流程AWS 如何協助客戶建立 DevOps 流程
AWS 如何協助客戶建立 DevOps 流程
 
Networking Best Practices for Your Serverless Applications
Networking Best Practices for Your Serverless ApplicationsNetworking Best Practices for Your Serverless Applications
Networking Best Practices for Your Serverless Applications
 
[AWS Container Service] Getting Started with Cloud Map, App Mesh and Firecracker
[AWS Container Service] Getting Started with Cloud Map, App Mesh and Firecracker[AWS Container Service] Getting Started with Cloud Map, App Mesh and Firecracker
[AWS Container Service] Getting Started with Cloud Map, App Mesh and Firecracker
 
muCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless ApplicationsmuCon 2017 - 12 Factor Serverless Applications
muCon 2017 - 12 Factor Serverless Applications
 
Deep Dive into Amazon Fargate
Deep Dive into Amazon FargateDeep Dive into Amazon Fargate
Deep Dive into Amazon Fargate
 
Deep Dive on Amazon Managed Blockchain
Deep Dive on Amazon Managed BlockchainDeep Dive on Amazon Managed Blockchain
Deep Dive on Amazon Managed Blockchain
 
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
AWS Startup Day - Boston 2018 - The Best Practices and Hard Lessons Learned o...
 
Automatically scaling your Kubernetes workloads - SVC210-S - Santa Clara AWS ...
Automatically scaling your Kubernetes workloads - SVC210-S - Santa Clara AWS ...Automatically scaling your Kubernetes workloads - SVC210-S - Santa Clara AWS ...
Automatically scaling your Kubernetes workloads - SVC210-S - Santa Clara AWS ...
 
EKS Workshop
 EKS Workshop EKS Workshop
EKS Workshop
 
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 BarcelonaAWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
 
Best Practices for AWS PrivateLink (NET301) - AWS re:Invent 2018
Best Practices for AWS PrivateLink (NET301) - AWS re:Invent 2018Best Practices for AWS PrivateLink (NET301) - AWS re:Invent 2018
Best Practices for AWS PrivateLink (NET301) - AWS re:Invent 2018
 
20210608 - Desarrollo de aplicaciones en la nube
20210608 - Desarrollo de aplicaciones en la nube20210608 - Desarrollo de aplicaciones en la nube
20210608 - Desarrollo de aplicaciones en la nube
 
Introduction to Amazon EKS
Introduction to Amazon EKSIntroduction to Amazon EKS
Introduction to Amazon EKS
 
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
Microservices on AWS: Architectural Patterns and Best Practices | AWS Summit ...
 

Similar to Twelve-Factor Serverless Applications

Twelve-Factor serverless applications - MAD307 - New York AWS Summit
Twelve-Factor serverless applications - MAD307 - New York AWS SummitTwelve-Factor serverless applications - MAD307 - New York AWS Summit
Twelve-Factor serverless applications - MAD307 - New York AWS Summit
Amazon Web Services
 
Twelve-Factor serverless applications - MAD311 - Chicago AWS Summit
Twelve-Factor serverless applications - MAD311 - Chicago AWS SummitTwelve-Factor serverless applications - MAD311 - Chicago AWS Summit
Twelve-Factor serverless applications - MAD311 - Chicago AWS Summit
Amazon Web Services
 
Twelve-factor serverless applications - MAD302 - Santa Clara AWS Summit
Twelve-factor serverless applications - MAD302 - Santa Clara AWS SummitTwelve-factor serverless applications - MAD302 - Santa Clara AWS Summit
Twelve-factor serverless applications - MAD302 - Santa Clara AWS Summit
Amazon Web Services
 
Twelve-Factor Serverless Applications - MAD303 - Anaheim AWS Summit
Twelve-Factor Serverless Applications - MAD303 - Anaheim AWS SummitTwelve-Factor Serverless Applications - MAD303 - Anaheim AWS Summit
Twelve-Factor Serverless Applications - MAD303 - Anaheim AWS Summit
Amazon Web Services
 
Serverless Functions Deep Dive
Serverless Functions Deep DiveServerless Functions Deep Dive
Serverless Functions Deep Dive
Amazon Web Services
 
Building a Critical Communications Platform Using Serverless Technologies
Building a Critical Communications Platform Using Serverless TechnologiesBuilding a Critical Communications Platform Using Serverless Technologies
Building a Critical Communications Platform Using Serverless Technologies
Amazon Web Services
 
12 Factor Serverless Applications - Mike Morain, AWS - Cloud Native Day Tel A...
12 Factor Serverless Applications - Mike Morain, AWS - Cloud Native Day Tel A...12 Factor Serverless Applications - Mike Morain, AWS - Cloud Native Day Tel A...
12 Factor Serverless Applications - Mike Morain, AWS - Cloud Native Day Tel A...
Cloud Native Day Tel Aviv
 
Twelve Factor Serverless Applications
Twelve Factor Serverless ApplicationsTwelve Factor Serverless Applications
Twelve Factor Serverless Applications
Amazon Web Services
 
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
AWS Summits
 
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Amazon Web Services
 
Serverless functions deep dive
Serverless functions deep diveServerless functions deep dive
Serverless functions deep dive
Amazon Web Services
 
Devops on serverless
Devops on serverlessDevops on serverless
Devops on serverless
Sébastien ☁ Stormacq
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
AWS Summits
 
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
 
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...
Amazon Web Services
 
Serverless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLMServerless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLM
Boaz Ziniman
 
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
Amazon Web Services
 
Building CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless ApplicationsBuilding CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless Applications
Amazon Web Services
 
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Amazon Web Services
 
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
AWS Summits
 

Similar to Twelve-Factor Serverless Applications (20)

Twelve-Factor serverless applications - MAD307 - New York AWS Summit
Twelve-Factor serverless applications - MAD307 - New York AWS SummitTwelve-Factor serverless applications - MAD307 - New York AWS Summit
Twelve-Factor serverless applications - MAD307 - New York AWS Summit
 
Twelve-Factor serverless applications - MAD311 - Chicago AWS Summit
Twelve-Factor serverless applications - MAD311 - Chicago AWS SummitTwelve-Factor serverless applications - MAD311 - Chicago AWS Summit
Twelve-Factor serverless applications - MAD311 - Chicago AWS Summit
 
Twelve-factor serverless applications - MAD302 - Santa Clara AWS Summit
Twelve-factor serverless applications - MAD302 - Santa Clara AWS SummitTwelve-factor serverless applications - MAD302 - Santa Clara AWS Summit
Twelve-factor serverless applications - MAD302 - Santa Clara AWS Summit
 
Twelve-Factor Serverless Applications - MAD303 - Anaheim AWS Summit
Twelve-Factor Serverless Applications - MAD303 - Anaheim AWS SummitTwelve-Factor Serverless Applications - MAD303 - Anaheim AWS Summit
Twelve-Factor Serverless Applications - MAD303 - Anaheim AWS Summit
 
Serverless Functions Deep Dive
Serverless Functions Deep DiveServerless Functions Deep Dive
Serverless Functions Deep Dive
 
Building a Critical Communications Platform Using Serverless Technologies
Building a Critical Communications Platform Using Serverless TechnologiesBuilding a Critical Communications Platform Using Serverless Technologies
Building a Critical Communications Platform Using Serverless Technologies
 
12 Factor Serverless Applications - Mike Morain, AWS - Cloud Native Day Tel A...
12 Factor Serverless Applications - Mike Morain, AWS - Cloud Native Day Tel A...12 Factor Serverless Applications - Mike Morain, AWS - Cloud Native Day Tel A...
12 Factor Serverless Applications - Mike Morain, AWS - Cloud Native Day Tel A...
 
Twelve Factor Serverless Applications
Twelve Factor Serverless ApplicationsTwelve Factor Serverless Applications
Twelve Factor Serverless Applications
 
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
 
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
Twelve-Factor App Methodology and Modern Applications | AWS Summit Tel Aviv 2019
 
Serverless functions deep dive
Serverless functions deep diveServerless functions deep dive
Serverless functions deep dive
 
Devops on serverless
Devops on serverlessDevops on serverless
Devops on serverless
 
Getting Started with Serverless Architectures
Getting Started with Serverless ArchitecturesGetting Started with Serverless Architectures
Getting Started with Serverless Architectures
 
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...
 
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...
 
Serverless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLMServerless Beyond Functions - CTO Club Made in JLM
Serverless Beyond Functions - CTO Club Made in JLM
 
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
Building CI/CD Pipelines for Serverless Applications - SRV302 - re:Invent 2017
 
Building CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless ApplicationsBuilding CI-CD Pipelines for Serverless Applications
Building CI-CD Pipelines for Serverless Applications
 
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
 
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
 

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 Fargate
Amazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
Amazon 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
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
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 Workloads
Amazon Web Services
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
Amazon 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 sfatare
Amazon 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 NodeJS
Amazon 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 web
Amazon 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 sfatare
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
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
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
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
Amazon 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
 

Twelve-Factor Serverless Applications

  • 1. P U B L I C S E C T O R S U M M I T Washington, DC
  • 2. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 12 Factor Serverless Applications Eric Johnson Senior Developer Advocate - Serverless AWS 3 1 1 0 2 3
  • 3. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Who Am I? • @edjgeek • Sr. Developer Advocate – Serverless, AWS • Serverless/Tooling/Automation Geek • Dad of five • Husband of one • Musician Drummer
  • 4. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T
  • 5. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T The “12 Factor” model & serverless applications • 12 Factor applications were popularized by developers building large scale applications on platforms such as Heroku • In recent years the 12 Factor guidelines have been considered best practices for both developers and operations engineers regardless of the application’s use-case and at nearly any scale • Many of the 12 Factor guidelines align directly with best practices for serverless applications and are improved upon given the nature of AWS Lambda, Amazon API Gateway, and other AWS services • However, some of the 12 Factor guidelines don’t directly align with serverless applications or are interpreted very differently
  • 13. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Serverless applications Event source Function Services Changes in data state Requests to endpoints Changes in Resource state Node.js Python Java C# Go Ruby Runtime API
  • 14. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Common Lambda Use Cases Amazon API Gateway Amazon S3 Amazon SNS Amazon SQS Amazon Kinesis Amazon CloudWatch Web or Mobile Backend File Processing Queue Processing Notification ProcessingReal-Time Stream Processing Schedule Jobs
  • 15. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T The 12 factors Let’s explore how the 12 Factors apply to a serverless application: 1. Codebase 2. Dependencies 3. Config 4. Backing services 5. Build, release, run 6. Process 7. Port Binding 8. Concurrency 9. Disposability 10.Dev/prod parity 11.Logs 12.Admin processes
  • 16. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 1. Codebase 12Factor.net: “One codebase tracked in revision control, many deploys” Serverless Apps: All code should be stored in revision control (a development best practice). The same repository should be used for all environments deployed to. The bounds of an “application” differ in serverless terms: • If events are shared (ie. a common Amazon API Gateway) then Lambda function code for those events should be put in the same repository • Otherwise break “services” along event source into their own repositories
  • 17. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 2. Dependencies 12Factor.net: “Explicitly declare and isolate dependencies” Serverless Apps: Code that needs to be used by multiple functions should be packaged into its own library. Place those packages inside of your deployment package or into a AWS Lambda Layer. Node.js, Python, Ruby • .zip file consisting of your code and any dependencies • Use npm/pip to install libraries • All dependencies must be at root level Java • Either .zip file with all code/dependencies, or standalone .jar • Use Maven / Eclipse IDE plugins • Compiled class & resource files at root level, required jars in /lib directory C# (.NET Core) • Either .zip file with all code / dependencies, or a standalone .dll • Use NuGet / VisualStudio plugins • All assemblies (.dll) at root level Go • .zip file consisting of your Go binary and any dependencies • Use “go get” to install dependencies
  • 18. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Lambda Layers Lets functions easily share code: Upload layer once, reference within any function Layer can be anything: dependencies, training data, configuration files, etc. Promote separation of responsibilities, lets developers iterate faster on writing business logic Built in support for secure sharing by ecosystem
  • 19. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Using Lambda Layers • Put common components in a ZIP file and upload it as a Lambda Layer • Layers are immutable and can be versioned to manage updates • When a version is deleted or permissions to use it are revoked, functions that used it previously will continue to work, but you won’t be able to create new ones • You can reference up to five layers, one of which can optionally be a custom runtime Lambda Layers arn:aws:lambda:region:accountId:layer:shared-lib :1 Lambda Layers arn:aws:lambda:region:accountId:layer:shared-lib:2 Lambda Layers arn:aws:lambda:region:accountId:layer:shared-lib:3
  • 20. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 3. Config 12Factor.net: “Store config in the environment” Serverless Apps: Many ways to do this in serverless applications: • Lambda Environment Variables: • Key-value pairs available via standard environment variable APIs such as process.env for Node.js or os.environ for Python • Support KMS encryption • API Gateway Stages: • Key-value pairs available for configuring API Gateway functionality or to pass on to HTTP endpoints as URI parameters or configuration parameters to a Lambda invocation • AWS Systems Manager Parameter Store:
  • 21. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T AWS Systems Manager – Parameter Store Centralized store to manage your configuration data • supports hierarchies • plain-text or encrypted with KMS • Can send notifications of changes to Amazon SNS/ AWS Lambda • Can be secured with IAM • Calls recorded in AWS CloudTrail • Can be tagged • Integrated with AWS Secrets Manager • Available via API/SDK Useful for: centralized environment variables, secrets control, feature flags from __future__ import print_function import json, boto3 ssm = boto3.client('ssm', 'us-east-1') def get_parameters(): response = ssm.get_parameters( Names=['LambdaSecureString'],WithDe cryption=True ) for parameter in response['Parameters']: return parameter['Value'] def lambda_handler(event, context): value = get_parameters() print("value1 = " + value) return value # Echo back the first key value
  • 22. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 4. Backing services 12Factor.net: “Treat backing services as attached resources” Serverless Apps: No differences. Resources that AWS Lambda functions connect to, such as databases, should have their endpoints and access credentials made available via config resources or IAM policies 👍
  • 23. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 5. Build, release, run 12Factor.net: “Strictly separate build and run stages” Serverless Apps: No differences. Development best practices such as Continuous Integration and Continuous Delivery should be followed. • Use AWS CodeBuild and AWS CodePipeline to support this: AWS CodePipelineAWS CodeBuild
  • 24. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T buildspec.yml Example version: 0.1 environment_variables: plaintext: "INPUT_FILE": "saml.yaml” "S3_BUCKET": "" phases: install: commands: - npm install pre_build: commands: - eslint *.js build: commands: - npm test post_build: commands: - aws cloudformation package --template $INPUT_FILE --s3-bucket $S3_BUCKET --output-template post-saml.yaml artifacts: type: zip files: - post-saml.yaml - beta.json
  • 25. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T buildspec.yml Example • Variables to be used by phases of build • Examples for what you can do in the phases of a build: • You can install packages or run commands to prepare your environment in ”install”. • Run syntax checking, commands in “pre_build”. • Execute your build tool/command in “build” • Test your app further or ship a container image to a repository in post_build • Create and store an artifact in S3 version: 0.1 environment_variables: plaintext: "INPUT_FILE": "saml.yaml” "S3_BUCKET": "" phases: install: commands: - npm install pre_build: commands: - eslint *.js build: commands: - npm test post_build: commands: - aws cloudformation package --template $INPUT_FILE --s3-bucket $S3_BUCKET --output-template post-saml.yaml artifacts: type: zip files: - post-saml.yaml - beta.json
  • 26. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T An example minimal Developer’s pipeline: MyBranch-Source Source CodeCommit Build test-build-source CodeBuild This pipeline: • Three Stages • Builds code artifact • One Development environment • Uses SAM/CloudFormation to deploy artifact and other AWS resources • Has Lambda custom actions for running my own testing functions MyDev-Deploy create-changeset AWS CloudFormation execute-changeset AWS CloudFormation Run-stubs AWS Lambda MyApplication
  • 27. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T An example minimal production pipeline: This pipeline: • Five Stages • Builds code artifact • Three deployed to “Environments” • Uses SAM/CloudFormation to deploy artifact and other AWS resources • Has Lambda custom actions for running my own testing functions • Integrates with a 3rd party service • Has a manual approval before deploying to production Source Source CodeCommit MyApplication Build test-build-source CodeBuild Deploy Testing create-changeset AWS CloudFormation execute-changeset AWS CloudFormation Run-stubs AWS Lambda Deploy Staging create-changeset AWS CloudFormation execute-changeset AWS CloudFormation Run-API-test Runscope QA-Sign-off Manual Approval Review Deploy Prod create-changeset AWS CloudFormation execute-changeset AWS CloudFormation Post-Deploy-Slack AWS Lambda
  • 28. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 6. Process 12Factor.net: “Execute the app as one or more stateless processes” Serverless Apps: This is inherent in how Lambda is designed already: • Lambda Functions should be treated as stateless despite the potential to store some state in-between execution environment re-use. • There is no promise of execution environment re-use between function invocations. • Data that needs to be kept should be stored off Lambda in a stateful service such as a database or cache.
  • 29. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 7. Port Binding 12Factor.net: “Export services via port binding” Serverless Apps: In Lambda/serverless applications this factor doesn’t apply the same due to a difference in how Lambda Functions are accessed: • Instead of a “port” Lambda functions are invoked via one or more triggering services or AWS’s APIs for Lambda • When it comes to Lambda functions there are 3 models for how they can be invoked; synchronously, asynchronously, and poll-based • Instead of having one function support multiple invocation sources, create independent functions
  • 30. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T AWS Lambda API 1. Lambda directly invoked via invoke API SDK clients Lambda function 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
  • 31. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Lambda execution model Synchronous (push) Amazon API Gateway AWS Lambda function /order Asynchronous (event) Amazon SNS AWS Lambda function Amazon S3 reqs Poll-based Amazon DynamoDB Amazon Kinesis changes AWS Lambda service function
  • 32. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 8. Concurrency 12Factor.net: “Scale out via the process model” Serverless Apps: Doesn’t apply as Lambda functions will scale automatically based on load. You can fork threads inside of your function execution but there are practical limits due to the memory and CPU/network constraints of your functions based on how you configure them. 👍
  • 33. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Tweak your function’s computer power Lambda exposes only a memory control, with the % of CPU core and network capacity allocated to a function proportionally Is your code CPU, Network or memory-bound? If so, it could be cheaper to choose more memory.
  • 34. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Smart resource allocation Match resource allocation (up to 3 GB!) to logic Stats for Lambda function that calculates 1,000 times all prime numbers <= 1,000,000 128 MB 11.722965sec $0.024628 256 MB 6.678945sec $0.028035 512 MB 3.194954sec $0.026830 1024 MB 1.465984sec $0.024638 Green==Best Red==Worst
  • 35. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Smart resource allocation Match resource allocation (up to 3 GB!) to logic Stats for Lambda function that calculates 1,000 times all prime numbers <= 1,000,000 128 MB 11.722965sec $0.024628 256 MB 6.678945sec $0.028035 512 MB 3.194954sec $0.026830 1024 MB 1.465984sec $0.024638 Green==Best Red==Worst -10.25698sec +$0.00001
  • 36. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 9. Disposability 12Factor.net: “Maximize robustness with fast startup and graceful shutdown” Serverless Apps: Shutdown doesn’t apply as Lambda functions and their invocation are tied directly to incoming events. Speed at startup does matter though and is a factor of deployment package size + language used + VPC (or not) + pre-handler code calls. 👍
  • 37. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 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 as well as reports data back to X-Ray itself var AWSXRay = require(‘aws-xray-sdk-core‘); var AWS = AWSXRay.captureAWS(require(‘aws- sdk’)); S3Client = AWS.S3();
  • 38. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T X-Ray Trace Example
  • 39. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 10. Dev/prod parity 12Factor.net: “Keep development, staging, and production as similar as possible” Serverless Apps: This can be made incredibly easy with serverless applications by: • Making use of environment/stage variables or Parameter Store for configuration information, backend resources, etc • Using Serverless Application Models (SAM) to deploy your application • Can pass environment/stage variables via Parameters, Mappings, Imports • Having a CI/CD process and tooling that supports multiple environments or accounts
  • 40. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Meet SAM!
  • 41. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T AWS Serverless Application Model (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
  • 42. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 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: nodejs6.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.P U B L I C S E C TO R S U M M I T AWS SAM Template Tells AWS CloudFormation this is a SAM template it needs to “transform” Creates a AWS 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 a Amazon DynamoDB table with 5 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: nodejs6.10 Policies: AmazonDynamoDBReadOnlyAccess Events: GetHtml: Type: Api Properties: Path: /{proxy+} Method: ANY ListTable: Type: AWS::Serverless::SimpleTable
  • 44. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T https://github.com/awslabs/aws-serverless-samfarm/blob/master/api/saml.yaml <-THIS BECOMES THIS- > AWS SAM Template
  • 45. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T AWS SAM Command Line Interface (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 AWS CloudWatch logs Can help you build in native dependencies https://aws.amazon.com/serverless/sam
  • 46. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 11. Logs 12Factor.net: “Treat logs as event streams” Serverless Apps: Logging (as well as Metric collection) are considered a “universal right” in Lambda: • Console output automatically collected and sent to Amazon CloudWatch Logs • Logs can be turned into Metrics • Logs can be sent to Amazon S3 or Amazon ElasticSearch Service easily for further inspection and trending • Metrics for Lambda and API Gateway for several key stats are automatically collected and sent to CloudWatch • You can easily send more using the CloudWatch SDK
  • 47. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T 12. Admin processes 12Factor.net: “Run admin/management tasks as one-off processes” Serverless Apps: Doesn’t apply to Lambda since you already limit your functions based on use case. True administrative tasks would occur via their own Lambda Functions or via tools such as Amazon EC2 Run Command. 👍
  • 48. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T The 12 Factors & Serverless Applications: As we’ve seen, 12 Factor application design can still be applied to serverless applications taking into account some small differences! = Works similarly = Not relevant 1. Codebase 5. Build, release, run 9. Disposability 2. Dependencies 6. Process 10. Dev/prod parity 3. Config 7. Port Binding 11. Logs 4. Backing services 8. Concurrency 12. Admin processes
  • 49. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T
  • 50. “ Pinpoint Moves Production Times from Weeks to Minutes with AWS Lambda Pinpoint needed to simplify—both their internal workflow and analytics processing pipeline, as well as the process for building microservices across their various teams and products. Pinpoint switched from using Kubernetes to AWS Lambda to rewrite their entire API tier, internal workflow, and analytics processing pipeline. • Deploys fixes and features multiple times a day • Simplifies internal workflow and analytics processing • Scales the adoption of microservices across teams and products SolutionChallenge Benefits Company: Pinpoint Industry: Software Data Science Country: United States Website: www.pinpoint.com ” “ - Jeff Haynie, Co-founder and CEO at Pinpoint We can have a commit roll into production…in literally minutes, as well as provide a bunch of flexible routing options dynamically. Pinpoint provides actionable insights for software executives. By applying data science to unearth how organizations really work, Pinpoint helps leaders advance the way people and teams deliver software. About Pinpoint
  • 51. “ Autodesk Saves 99% with AWS Lambda, Amazon DynamoDB & Amazon API Gateway Setting up accounts was a bottleneck for Autodesk’s two- person team. The account creation process was manual with static configurations, and making any changes or updates required a team member to sign into hundreds of accounts, one at a time, resulting in two-week turnarounds. Autodesk built “Tailor,” a solution using Amazon DynamoDB for data persistence and Amazon API Gateway for API endpoints, and automated all processes using AWS Lambda. Autodesk developers now submit an online form to request a new account and an API request triggers the account-creation process. • Saves 99% of previous costs • Supports queries by account number, email address, or IP address • Saves up to one month of development time SolutionChallenge Benefits Company: Autodesk Industry: Software products for Entertainment, Architecture, Construction, Engineering, Manufacturing & Media Industries Country: United States Website: www.autodesk.com Autodesk offers software products aimed at the architecture, construction, engineering, manufacturing, media and entertainment industries. Headquartered in California, Autodesk has 10,000 employees in offices around the world. “ Prior to implementing Tailor, our cost to provision each account was about $500 in employee time. It’s just shy of $6 per account (now), which means we can create about 10 times as many accounts for the same cost. - Alan Williams, Enterprise Architect at Autodesk About Autodesk
  • 52. “ FINRA Doubles Cost Efficiency with AWS Lambda Data is ingested into Amazon S3 via FTP and AWS Lambda performs the validations. Amazon EC2 manages data feeds coming into, and notifications going out of, AWS Lambda. Amazon SQS is used for input /output messaging notifications while Amazon VPC partitions the system into separate test and production accounts. • Delivered solution in three months • Accelerated data validation by 700% • Increased cost efficiency by a factor of two SolutionChallenge Benefits Company: FINRA Industry: Financial Regulatory Non- Profit Country: United States Website: www.finra.org The Financial Industry Regulatory Authority (FINRA) is a not-for-profit organization which protects investors and ensures market integrity through effective regulation of 3,800 broker- dealers. They write and enforce rules, examine firms for compliance, foster market transparency, and educate investors. “ Using AWS Lambda, we’ve increased cost efficiency by a factor of two. We only pay for what we use, and we don’t have to manage on-premises server infrastructure.” - Tim Greisback, Senior Director of Technology, FINRA About FINRA FINRA validates the data of 50,000 broker-dealer OATS (Order Audit Trail System) files and formats them according to 200 rules, which totals half a trillion validations each day. FINRA needed a solution that could scale with processing demand, which can double or triple in response to market conditions.
  • 53. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T FIN, ACK (in closing) As we’ve reviewed the 12 Factor methodology for applications we’ve seen which factors do and do not apply the same for serverless applications: • Thinking about code reusability and how to scope your functions to the smallest size necessary provides many benefits • Factors related to underlying process management, network ports, concurrency, and admin processes are largely not an issue in serverless applications due to Lambda’s product design and features • Best practices for serverless align pretty closely with 12 Factor guidance already, so you might be really close to meeting the “12 Factor” bar already!
  • 54. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T aws.amazon.com/serverless/sam
  • 55. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T aws.amazon.com/serverless
  • 56. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T
  • 57. © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T
  • 58. Thank you! © 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.P U B L I C S E C TO R S U M M I T Eric Johnson @edjgeek