SlideShare a Scribd company logo
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Julien Simon
Principal Technical Evangelist, AWS
julsimon@amazon.fr
@julsimon

Developing and deploying
serverless applications
Agenda
•  What’s new on AWS Lambda?
•  Simplifying development
•  Demo: The Serverless framework
•  Demo: Gordon
•  Demo: Chalice
•  Other tools
•  Simplifying deployment
•  Demo: AWS Serverless Application Model
•  Additional resources
•  Q&A
"
"
What’s new on AWS Lambda?"
"
Environment variables for Lambda functions
 New
https://aws.amazon.com/fr/blogs/aws/new-for-aws-lambda-environment-variables-and-serverless-application-model/
Serverless CI/CD pipeline
GitHub
Source Deploy
CloudFormationCodeBuild
Build
NEW!
•  Pull source directly from GitHub or AWS CodeCommit "
using AWS CodePipeline
•  Build and package serverless apps with AWS CodeBuild
•  Deploy your completed Lambda app with AWS CloudFormation
https://docs.aws.amazon.com/lambda/latest/dg/automating-deployment.html
Easily create reliable end-to-end event processing solutions
•  Sends all unprocessed events
to your SQS queue or SNS
topic: 3-strike rule
•  Preserves events even if your
code has an issue or the call
was throttled
•  Per-function
•  Works for all async invokes,
including S3 and SNS events 
Dead-letter queue for events
New
Amazon
SQS
Amazon
SNS
AWS
Lambda
https://docs.aws.amazon.com/lambda/latest/dg/dlq.html
•  Attempt a function more than 3X
•  Add callbacks to asynchronous functions
•  Handle situations that require waiting
•  Chain function execution (AàBàC)
•  Supports long-running workflows
AWS Step Functions
New
Reliably orchestrate multiple Lambda functions
https://aws.amazon.com/fr/blogs/aws/new-aws-step-functions-build-distributed-applications-using-visual-workflows/
"
Simplifying Development "
"Code samples available at https://github.com/juliensimon/aws/tree/master/lambda_frameworks "
"
Typical development workflow
1.  Write and deploy a Lambda function
2.  Create a REST API with API Gateway
3.  Connect the API to the Lambda function
4.  Invoke the API
5.  Test, debug and repeat ;)
The Serverless framework "
formerly known as JAWS: Just AWS Without Servers













•  Announced at re:Invent 2015 by Austen Collins and Ryan Pendergast
•  Supports Node.js, as well as Python and Java
•  Auto-deploys and runs Lambda functions, locally or remotely

•  Auto-deploys your Lambda event sources: API Gateway, S3, DynamoDB, etc.
•  Creates all required infrastructure with CloudFormation
•  Simple configuration in YML

http://github.com/serverless/serverless 
https://serverless.com 
AWS re:Invent 2015 | (DVO209) https://www.youtube.com/watch?v=D_U6luQ6I90 & https://vimeo.com/141132756
Serverless: “Hello World” API
$ serverless create
Edit handler.js, serverless.yml and event.json
$ serverless deploy [--stage stage_name]
$ serverless invoke [local] --function function_name
$ serverless info
$ http $URL
$ serverless remove
Demo: "
Serverless Framework
Gordon
•  Released in Oct’15 by Jorge Batista
•  Supports Python, Javascript, Golang, Java, Scala, Kotlin (including in the same project)
•  Auto-deploys and runs Lambda functions, locally or remotely
•  Auto-deploys your Lambda event sources: API Gateway, CloudWatch Events, DynamoDB
Streams, Kinesis Streams, S3
•  Creates all required infrastructure with CloudFormation
•  Simple configuration in YML
https://github.com/jorgebastida/gordon 
https://news.ycombinator.com/item?id=11821295
Gordon: “Hello World” API
$ gordon startproject helloworld
$ gordon startapp helloapp
Write hellofunc() function
$ gordon build
$ echo '{"name":"Julien"}' | gordon run helloapp.hellofunc
$ gordon apply [--stage stage_name]
$ http post $URL name=Julien
Demo: "
Gordon
AWS Chalice "
Think of it as a serverless framework for Flask apps"

•  Released in Jul’16, still in beta
•  Just add your Python code
•  Deploy with a single call and zero config
•  The API is created automatically, the IAM policy is auto-generated
•  Run APIs locally on port 8000 (similar to Flask)
•  Fast & lightweight framework
•  100% boto3 calls (AWS SDK for Python) à fast
•  No integration with CloudFormation à no creation of event sources
https://github.com/awslabs/chalice 
https://aws.amazon.com/blogs/developer/preview-the-python-serverless-microframework-for-aws/
AWS Chalice: “Hello World” API
$ chalice new-project helloworld
Write your function in app.py
$ chalice local
$ chalice deploy
$ export URL=`chalice url`
$ http $URL
$ http put $URL/hello/julien
$ chalice logs [ --include-lambda-messages ]
AWS Chalice: PUT/GET in S3 bucket
$ chalice new-project s3test
Write your function in app.py
$ chalice local
$ http put http://localhost:8000/objects/doc.json value1=5 value2=8
$ http get http://localhost:8000/objects/doc.json
$ chalice deploy [stage_name]
$ export URL=`chalice url`
$ http put $URL/objects/doc.json value1=5 value2=8
$ http get $URL/objects/doc.json
Demo: "
Chalice
Summing things up
Serverless

The most popular
serverless framework

Built with and for Node.js.
Python and Java: YMMV

Rich features, many event
sources

Not a web framework
Gordon

Great challenger!

Node.js, Python, Java,
Scala, Golang

Comparable to Serverless
feature-wise

Not a web framework



Chalice

AWS project, in beta

Python only

Does only one thing, but
does it great

Dead simple, zero config

Flask web framework
More Lambda frameworks
•  Kappa https://github.com/garnaat/kappa 
•  Released Dec’14 by Mitch Garnaat, author of boto and the AWS CLI (still maintained?)
•  Python only, multiple event sources
•  Apex https://github.com/apex/apex 
•  Released in Dec’15 by TJ Holowaychuk
•  Python, Javascript, Java, Golang
•  Terraform integration to manage infrastructure for event sources
•  Zappa https://github.com/Miserlou/Zappa 
•  Released in Feb’16 by Rich Jones
•  Python web applications on AWS Lambda + API Gateway
•  Docker-lambda https://github.com/lambci/docker-lambda 
•  Released in May’16 by Michael Hart
•  Run functions in Docker images that “replicate” the live Lambda environment
2 Java tools for AWS Lambda













https://java.awsblog.com/post/TxWZES6J1RSQ2Z/Testing-Lambda-functions-using-the-AWS-Toolkit-for-Eclipse 
https://aws.amazon.com/blogs/developer/aws-toolkit-for-eclipse-serverless-application
https://github.com/awslabs/aws-serverless-java-container 
Eclipse plug-in

•  Code, test and deploy Lambda from Eclipse
•  Run your functions locally and remotely
•  Test with local events and Junit4 
•  Deploy standalone functions, or with the "
AWS Serverless Application Model (Dec’16)
Serverless Java Container

•  Run Java RESTful APIs as-is
•  Default implementation of the
Java servlet
HttpServletRequest "
HttpServletResponse
•  Support for Java frameworks
such as Jersey or Spark
"
"
Simplifying Deployment"
AWS Serverless Application Model (SAM)"
formerly known as Project Flourish
•  CloudFormation extension released in Nov’16 to bundle
Lambda functions, APIs & events
•  3 new CloudFormation resource types
•  AWS::Serverless::Function
•  AWS::Serverless::Api
•  AWS::Serverless::SimpleTable
•  2 new CloudFormation CLI commands
•  ‘aws cloudformation package’
•  ‘aws cloudformation deploy’
•  Integration with CodeBuild and CodePipeline for CI/CD
•  Expect SAM to be integrated in most / all frameworks
https://aws.amazon.com/fr/blogs/compute/introducing-simplified-serverless-application-deplyoment-and-management 
https://github.com/awslabs/serverless-application-model/ 
New
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources: GetHtmlFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://flourish-demo-bucket/todo_list.zip
Handler: index.gethtml
Runtime: nodejs4.3
Policies: AmazonDynamoDBReadOnlyAccess
Events:
GetHtml: Type: Api
Properties: Path: /{proxy+} Method: ANY
ListTable: Type: AWS::Serverless::SimpleTable
Functions
APIs
Storage
AWS Serverless Application Model
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources: GetHtmlFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://flourish-demo-bucket/todo_list.zip
Handler: index.gethtml
Runtime: nodejs4.3
Policies: AmazonDynamoDBReadOnlyAccess
Events:
GetHtml: Type: Api
Properties: Path: /{proxy+} Method: ANY
ListTable: Type: AWS::Serverless::SimpleTable
AWSTemplateFormatVersion: '2010-09-09'
Resources:
GetHtmlFunctionGetHtmlPermissionProd:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:invokeFunction
Principal: apigateway.amazonaws.com
FunctionName:
Ref: GetHtmlFunction
SourceArn:
Fn::Sub: arn:aws:execute-api:${AWS::Region}:
${AWS::AccountId}:${ServerlessRestApi}/Prod/
ANY/*
ServerlessRestApiProdStage:
Type: AWS::ApiGateway::Stage
Properties:
DeploymentId:
Ref: ServerlessRestApiDeployment
RestApiId:
Ref: ServerlessRestApi
StageName: Prod
ListTable:
Type: AWS::DynamoDB::Table
Properties:
ProvisionedThroughput:
WriteCapacityUnits: 5
ReadCapacityUnits: 5
AttributeDefinitions:
- AttributeName: id
AttributeType: S
KeySchema:
- KeyType: HASH
AttributeName: id
GetHtmlFunction:
Type: AWS::Lambda::Function
Properties:
Handler: index.gethtml
Code:
S3Bucket: flourish-demo-bucket
S3Key: todo_list.zip

Role:
Fn::GetAtt:
- GetHtmlFunctionRole
- Arn
Runtime: nodejs4.3
GetHtmlFunctionRole:
Type: AWS::IAM::Role
Properties:
ManagedPolicyArns:
- arn:aws:iam::aws:policy/
AmazonDynamoDBReadOnlyAccess
- arn:aws:iam::aws:policy/service-role/
AWSLambdaBasicExecutionRole
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Action:
- sts:AssumeRole
Effect: Allow
Principal:
Service:
- lambda.amazonaws.com
ServerlessRestApiDeployment:
Type: AWS::ApiGateway::Deployment
Properties:
RestApiId:
Ref: ServerlessRestApi
Description: 'RestApi deployment id:
127e3fb91142ab1ddc5f5446adb094442581a
90d'
StageName: Stage
GetHtmlFunctionGetHtmlPermissionTest:
Type: AWS::Lambda::Permission

Properties:
Action: lambda:invokeFunction
Principal: apigateway.amazonaws.com
FunctionName:
Ref: GetHtmlFunction
SourceArn:
Fn::Sub: arn:aws:execute-api:${AWS::Region}:
${AWS::AccountId}:${ServerlessRestApi}/*/
ANY/*
ServerlessRestApi:
Type: AWS::ApiGateway::RestApi
Properties:
Body:
info:
version: '1.0'
title:
Ref: AWS::StackName
paths:
"/{proxy+}":
x-amazon-apigateway-any-method:
x-amazon-apigateway-integration:
httpMethod: ANY
type: aws_proxy
uri:
Fn::Sub: arn:aws:apigateway:$
{AWS::Region}:lambda:path/2015-03-
31/functions/${GetHtmlFunction.Arn}/
invocations
responses: {}
swagger: '2.0'
AWS Serverless Application Model
REPLACES:
SAM: Open Specification

Apache 2.0 licensed 

GitHub project


New
https://github.com/
awslabs/serverless-
application-model
Demo: "
Serverless Application Model"
Additional resources
The only Lambda book you need to read
Written by AWS Technical
Evangelist Danilo Poccia

Just released!

https://www.amazon.com/Aws-Lambda-Action-
Event-driven-Applications/dp/1617293717/
New Lambda videos from re:Invent 2016
AWS re:Invent 2016: What’s New with AWS Lambda (SVR202)
https://www.youtube.com/watch?v=CwxWhyGteNc 

AWS re:Invent 2016: Serverless Apps with AWS Step Functions (SVR201)
https://www.youtube.com/watch?v=75MRve4nv8s 

AWS re:Invent 2016: Real-time Data Processing Using AWS Lambda (SVR301)
https://www.youtube.com/watch?v=VFLKOy4GKXQ 

AWS re:Invent 2016: Serverless Architectural Patterns and Best Practices (ARC402)
https://www.youtube.com/watch?v=b7UMoc1iUYw 

‪AWS re:Invent 2016: Bringing AWS Lambda to the Edge (CTD206)‬
https://www.youtube.com/watch?v=j26novaqF6M 

‪AWS re:Invent 2016: Ubiquitous Computing with Greengrass (IOT201)‬
https://www.youtube.com/watch?v=XQQjX8GTEko
AWS User Groups
Lille
Paris
Rennes
Nantes
Bordeaux
Lyon
Montpellier
Toulouse
Côte d’Azur (soon!)
facebook.com/groups/AWSFrance/
@aws_actus
Merci !
Julien Simon
Principal Technical Evangelist, AWS
julsimon@amazon.fr
@julsimon

More Related Content

PDF
Building serverless apps with Node.js
PDF
Serverless Frameworks on AWS
PDF
Building Serverless APIs on AWS
PDF
Building Serverless APIs (January 2017)
PDF
Continuous Deployment with Amazon Web Services
PDF
An introduction to serverless architectures (February 2017)
PDF
Building a Serverless Pipeline
PDF
Infrastructure as code with Amazon Web Services
Building serverless apps with Node.js
Serverless Frameworks on AWS
Building Serverless APIs on AWS
Building Serverless APIs (January 2017)
Continuous Deployment with Amazon Web Services
An introduction to serverless architectures (February 2017)
Building a Serverless Pipeline
Infrastructure as code with Amazon Web Services

What's hot (12)

PDF
Write less (code) and build more with serverless
PDF
DevOps with Amazon Web Services (November 2016)
PDF
AWS CloudFormation (February 2016)
PDF
A 60-minute tour of AWS Compute (November 2016)
PPTX
Moving Viadeo to AWS (2015)
PDF
Deep Dive: Amazon Relational Database Service (March 2017)
PDF
Serverless architecture with AWS Lambda (June 2016)
PDF
An Overview of AWS IoT (November 2016)
PDF
A 60-mn tour of AWS compute (March 2016)
PDF
A real-life account of moving 100% to a public cloud
PDF
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
PPTX
Continuous delivery and deployment on AWS
Write less (code) and build more with serverless
DevOps with Amazon Web Services (November 2016)
AWS CloudFormation (February 2016)
A 60-minute tour of AWS Compute (November 2016)
Moving Viadeo to AWS (2015)
Deep Dive: Amazon Relational Database Service (March 2017)
Serverless architecture with AWS Lambda (June 2016)
An Overview of AWS IoT (November 2016)
A 60-mn tour of AWS compute (March 2016)
A real-life account of moving 100% to a public cloud
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
Continuous delivery and deployment on AWS
Ad

Viewers also liked (20)

PDF
Amazon AI (February 2017)
PDF
Viadeo - Cost Driven Development
PDF
The AWS DevOps combo (January 2017)
PDF
Devops with Amazon Web Services (January 2017)
PDF
Bonnes pratiques pour la gestion des opérations de sécurité AWS
PDF
Authentification et autorisation d'accès avec AWS IAM
PDF
IoT: it's all about Data!
PDF
Amazon Inspector
PPTX
Presentación dia de andalucia pedro
PPT
Iot og personvern 2017
ODP
Com clonar i com exportar i importar una màquina virtual
PDF
Labo XX Antwerp - Densification strategies for the 20th century belt (BUUR)
PPTX
Filafat ilmu kepolisian
PDF
AWS re:Invent 2016 recap (part 2)
PDF
Big Data answers in seconds with Amazon Athena
PDF
Repubblicanesimo, repubblicanismo, republicanismo, républicanisme, republican...
PDF
Postmarxismo, post marxismo, post marxismo
PPTX
Património Cultural Português - Panteões de Portugal e Edifícios da Soberania...
PPT
презентація впм технологія емалей 2017
PDF
Stranger Danger: Securing Third Party Components (Tech2020)
Amazon AI (February 2017)
Viadeo - Cost Driven Development
The AWS DevOps combo (January 2017)
Devops with Amazon Web Services (January 2017)
Bonnes pratiques pour la gestion des opérations de sécurité AWS
Authentification et autorisation d'accès avec AWS IAM
IoT: it's all about Data!
Amazon Inspector
Presentación dia de andalucia pedro
Iot og personvern 2017
Com clonar i com exportar i importar una màquina virtual
Labo XX Antwerp - Densification strategies for the 20th century belt (BUUR)
Filafat ilmu kepolisian
AWS re:Invent 2016 recap (part 2)
Big Data answers in seconds with Amazon Athena
Repubblicanesimo, repubblicanismo, republicanismo, républicanisme, republican...
Postmarxismo, post marxismo, post marxismo
Património Cultural Português - Panteões de Portugal e Edifícios da Soberania...
презентація впм технологія емалей 2017
Stranger Danger: Securing Third Party Components (Tech2020)
Ad

Similar to Developing and deploying serverless applications (February 2017) (20)

PDF
用Serverless技術快速開發line聊天機器人
PDF
Building serverless applications (April 2018)
PDF
Čtvrtkon #64 - AWS Serverless - Michal Haták
PDF
Serverless Architecture - A Gentle Overview
PDF
Serverless Meetup - 12 gennaio 2017
PDF
AWSomeDay Zurich 2018 - How to go serverless
PDF
Serverless Frameworks.pdf
PDF
Serverless Computing, AWS Way: SourceFuse Technologies
PDF
Serverless Computing, AWS Way by SourceFuse Technologies
PDF
Building applications with Serverless Framework and AWS Lambda - JavaZone 2019
PDF
Devops on serverless
PPTX
AWS Serverless concepts and solutions
PDF
PyConIT 2018 Writing and deploying serverless python applications
PDF
12 Factor Serverless Applications - Mike Morain, AWS - Cloud Native Day Tel A...
PDF
Writing and deploying serverless python applications
PDF
PyConIE 2017 Writing and deploying serverless python applications
PDF
Run Code, Not Servers: AWS Lambda
PPTX
muCon 2017 - 12 Factor Serverless Applications
PDF
Python in the Serverless Era (PyCon IL 2016)
PPTX
Primeros pasos en desarrollo serverless
用Serverless技術快速開發line聊天機器人
Building serverless applications (April 2018)
Čtvrtkon #64 - AWS Serverless - Michal Haták
Serverless Architecture - A Gentle Overview
Serverless Meetup - 12 gennaio 2017
AWSomeDay Zurich 2018 - How to go serverless
Serverless Frameworks.pdf
Serverless Computing, AWS Way: SourceFuse Technologies
Serverless Computing, AWS Way by SourceFuse Technologies
Building applications with Serverless Framework and AWS Lambda - JavaZone 2019
Devops on serverless
AWS Serverless concepts and solutions
PyConIT 2018 Writing and deploying serverless python applications
12 Factor Serverless Applications - Mike Morain, AWS - Cloud Native Day Tel A...
Writing and deploying serverless python applications
PyConIE 2017 Writing and deploying serverless python applications
Run Code, Not Servers: AWS Lambda
muCon 2017 - 12 Factor Serverless Applications
Python in the Serverless Era (PyCon IL 2016)
Primeros pasos en desarrollo serverless

More from Julien SIMON (20)

PDF
Implementing high-quality and cost-effiient AI applications with small langua...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
PDF
Arcee AI - building and working with small language models (06/25)
PDF
deep_dive_multihead_latent_attention.pdf
PDF
Deep Dive: Model Distillation with DistillKit
PDF
Deep Dive: Parameter-Efficient Model Adaptation with LoRA and Spectrum
PDF
Building High-Quality Domain-Specific Models with Mergekit
PDF
Tailoring Small Language Models for Enterprise Use Cases
PDF
Tailoring Small Language Models for Enterprise Use Cases
PDF
Julien Simon - Deep Dive: Compiling Deep Learning Models
PDF
Tailoring Small Language Models for Enterprise Use Cases
PDF
Julien Simon - Deep Dive - Optimizing LLM Inference
PDF
Julien Simon - Deep Dive - Accelerating Models with Better Attention Layers
PDF
Julien Simon - Deep Dive - Quantizing LLMs
PDF
Julien Simon - Deep Dive - Model Merging
PDF
An introduction to computer vision with Hugging Face
PDF
Reinventing Deep Learning
 with Hugging Face Transformers
PDF
Building NLP applications with Transformers
PPTX
Building Machine Learning Models Automatically (June 2020)
Implementing high-quality and cost-effiient AI applications with small langua...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Trying to figure out MCP by actually building an app from scratch with open s...
Arcee AI - building and working with small language models (06/25)
deep_dive_multihead_latent_attention.pdf
Deep Dive: Model Distillation with DistillKit
Deep Dive: Parameter-Efficient Model Adaptation with LoRA and Spectrum
Building High-Quality Domain-Specific Models with Mergekit
Tailoring Small Language Models for Enterprise Use Cases
Tailoring Small Language Models for Enterprise Use Cases
Julien Simon - Deep Dive: Compiling Deep Learning Models
Tailoring Small Language Models for Enterprise Use Cases
Julien Simon - Deep Dive - Optimizing LLM Inference
Julien Simon - Deep Dive - Accelerating Models with Better Attention Layers
Julien Simon - Deep Dive - Quantizing LLMs
Julien Simon - Deep Dive - Model Merging
An introduction to computer vision with Hugging Face
Reinventing Deep Learning
 with Hugging Face Transformers
Building NLP applications with Transformers
Building Machine Learning Models Automatically (June 2020)

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Electronic commerce courselecture one. Pdf
PPTX
Big Data Technologies - Introduction.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
A Presentation on Artificial Intelligence
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Approach and Philosophy of On baking technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
Chapter 3 Spatial Domain Image Processing.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Reach Out and Touch Someone: Haptics and Empathic Computing
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Electronic commerce courselecture one. Pdf
Big Data Technologies - Introduction.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Understanding_Digital_Forensics_Presentation.pptx
A Presentation on Artificial Intelligence
Digital-Transformation-Roadmap-for-Companies.pptx
The AUB Centre for AI in Media Proposal.docx
Advanced methodologies resolving dimensionality complications for autism neur...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Monthly Chronicles - July 2025
Approach and Philosophy of On baking technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding

Developing and deploying serverless applications (February 2017)

  • 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Julien Simon Principal Technical Evangelist, AWS julsimon@amazon.fr @julsimon Developing and deploying serverless applications
  • 2. Agenda •  What’s new on AWS Lambda? •  Simplifying development •  Demo: The Serverless framework •  Demo: Gordon •  Demo: Chalice •  Other tools •  Simplifying deployment •  Demo: AWS Serverless Application Model •  Additional resources •  Q&A
  • 3. " " What’s new on AWS Lambda?" "
  • 4. Environment variables for Lambda functions New https://aws.amazon.com/fr/blogs/aws/new-for-aws-lambda-environment-variables-and-serverless-application-model/
  • 5. Serverless CI/CD pipeline GitHub Source Deploy CloudFormationCodeBuild Build NEW! •  Pull source directly from GitHub or AWS CodeCommit " using AWS CodePipeline •  Build and package serverless apps with AWS CodeBuild •  Deploy your completed Lambda app with AWS CloudFormation https://docs.aws.amazon.com/lambda/latest/dg/automating-deployment.html
  • 6. Easily create reliable end-to-end event processing solutions •  Sends all unprocessed events to your SQS queue or SNS topic: 3-strike rule •  Preserves events even if your code has an issue or the call was throttled •  Per-function •  Works for all async invokes, including S3 and SNS events Dead-letter queue for events New Amazon SQS Amazon SNS AWS Lambda https://docs.aws.amazon.com/lambda/latest/dg/dlq.html
  • 7. •  Attempt a function more than 3X •  Add callbacks to asynchronous functions •  Handle situations that require waiting •  Chain function execution (AàBàC) •  Supports long-running workflows AWS Step Functions New Reliably orchestrate multiple Lambda functions https://aws.amazon.com/fr/blogs/aws/new-aws-step-functions-build-distributed-applications-using-visual-workflows/
  • 8. " Simplifying Development " "Code samples available at https://github.com/juliensimon/aws/tree/master/lambda_frameworks " "
  • 9. Typical development workflow 1.  Write and deploy a Lambda function 2.  Create a REST API with API Gateway 3.  Connect the API to the Lambda function 4.  Invoke the API 5.  Test, debug and repeat ;)
  • 10. The Serverless framework " formerly known as JAWS: Just AWS Without Servers •  Announced at re:Invent 2015 by Austen Collins and Ryan Pendergast •  Supports Node.js, as well as Python and Java •  Auto-deploys and runs Lambda functions, locally or remotely •  Auto-deploys your Lambda event sources: API Gateway, S3, DynamoDB, etc. •  Creates all required infrastructure with CloudFormation •  Simple configuration in YML http://github.com/serverless/serverless https://serverless.com AWS re:Invent 2015 | (DVO209) https://www.youtube.com/watch?v=D_U6luQ6I90 & https://vimeo.com/141132756
  • 11. Serverless: “Hello World” API $ serverless create Edit handler.js, serverless.yml and event.json $ serverless deploy [--stage stage_name] $ serverless invoke [local] --function function_name $ serverless info $ http $URL $ serverless remove
  • 13. Gordon •  Released in Oct’15 by Jorge Batista •  Supports Python, Javascript, Golang, Java, Scala, Kotlin (including in the same project) •  Auto-deploys and runs Lambda functions, locally or remotely •  Auto-deploys your Lambda event sources: API Gateway, CloudWatch Events, DynamoDB Streams, Kinesis Streams, S3 •  Creates all required infrastructure with CloudFormation •  Simple configuration in YML https://github.com/jorgebastida/gordon https://news.ycombinator.com/item?id=11821295
  • 14. Gordon: “Hello World” API $ gordon startproject helloworld $ gordon startapp helloapp Write hellofunc() function $ gordon build $ echo '{"name":"Julien"}' | gordon run helloapp.hellofunc $ gordon apply [--stage stage_name] $ http post $URL name=Julien
  • 16. AWS Chalice " Think of it as a serverless framework for Flask apps" •  Released in Jul’16, still in beta •  Just add your Python code •  Deploy with a single call and zero config •  The API is created automatically, the IAM policy is auto-generated •  Run APIs locally on port 8000 (similar to Flask) •  Fast & lightweight framework •  100% boto3 calls (AWS SDK for Python) à fast •  No integration with CloudFormation à no creation of event sources https://github.com/awslabs/chalice https://aws.amazon.com/blogs/developer/preview-the-python-serverless-microframework-for-aws/
  • 17. AWS Chalice: “Hello World” API $ chalice new-project helloworld Write your function in app.py $ chalice local $ chalice deploy $ export URL=`chalice url` $ http $URL $ http put $URL/hello/julien $ chalice logs [ --include-lambda-messages ]
  • 18. AWS Chalice: PUT/GET in S3 bucket $ chalice new-project s3test Write your function in app.py $ chalice local $ http put http://localhost:8000/objects/doc.json value1=5 value2=8 $ http get http://localhost:8000/objects/doc.json $ chalice deploy [stage_name] $ export URL=`chalice url` $ http put $URL/objects/doc.json value1=5 value2=8 $ http get $URL/objects/doc.json
  • 20. Summing things up Serverless The most popular serverless framework Built with and for Node.js. Python and Java: YMMV Rich features, many event sources Not a web framework Gordon Great challenger! Node.js, Python, Java, Scala, Golang Comparable to Serverless feature-wise Not a web framework Chalice AWS project, in beta Python only Does only one thing, but does it great Dead simple, zero config Flask web framework
  • 21. More Lambda frameworks •  Kappa https://github.com/garnaat/kappa •  Released Dec’14 by Mitch Garnaat, author of boto and the AWS CLI (still maintained?) •  Python only, multiple event sources •  Apex https://github.com/apex/apex •  Released in Dec’15 by TJ Holowaychuk •  Python, Javascript, Java, Golang •  Terraform integration to manage infrastructure for event sources •  Zappa https://github.com/Miserlou/Zappa •  Released in Feb’16 by Rich Jones •  Python web applications on AWS Lambda + API Gateway •  Docker-lambda https://github.com/lambci/docker-lambda •  Released in May’16 by Michael Hart •  Run functions in Docker images that “replicate” the live Lambda environment
  • 22. 2 Java tools for AWS Lambda https://java.awsblog.com/post/TxWZES6J1RSQ2Z/Testing-Lambda-functions-using-the-AWS-Toolkit-for-Eclipse https://aws.amazon.com/blogs/developer/aws-toolkit-for-eclipse-serverless-application https://github.com/awslabs/aws-serverless-java-container Eclipse plug-in •  Code, test and deploy Lambda from Eclipse •  Run your functions locally and remotely •  Test with local events and Junit4 •  Deploy standalone functions, or with the " AWS Serverless Application Model (Dec’16) Serverless Java Container •  Run Java RESTful APIs as-is •  Default implementation of the Java servlet HttpServletRequest " HttpServletResponse •  Support for Java frameworks such as Jersey or Spark
  • 24. AWS Serverless Application Model (SAM)" formerly known as Project Flourish •  CloudFormation extension released in Nov’16 to bundle Lambda functions, APIs & events •  3 new CloudFormation resource types •  AWS::Serverless::Function •  AWS::Serverless::Api •  AWS::Serverless::SimpleTable •  2 new CloudFormation CLI commands •  ‘aws cloudformation package’ •  ‘aws cloudformation deploy’ •  Integration with CodeBuild and CodePipeline for CI/CD •  Expect SAM to be integrated in most / all frameworks https://aws.amazon.com/fr/blogs/compute/introducing-simplified-serverless-application-deplyoment-and-management https://github.com/awslabs/serverless-application-model/ New
  • 25. AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: GetHtmlFunction: Type: AWS::Serverless::Function Properties: CodeUri: s3://flourish-demo-bucket/todo_list.zip Handler: index.gethtml Runtime: nodejs4.3 Policies: AmazonDynamoDBReadOnlyAccess Events: GetHtml: Type: Api Properties: Path: /{proxy+} Method: ANY ListTable: Type: AWS::Serverless::SimpleTable Functions APIs Storage AWS Serverless Application Model
  • 26. AWSTemplateFormatVersion: '2010-09-09’ Transform: AWS::Serverless-2016-10-31 Resources: GetHtmlFunction: Type: AWS::Serverless::Function Properties: CodeUri: s3://flourish-demo-bucket/todo_list.zip Handler: index.gethtml Runtime: nodejs4.3 Policies: AmazonDynamoDBReadOnlyAccess Events: GetHtml: Type: Api Properties: Path: /{proxy+} Method: ANY ListTable: Type: AWS::Serverless::SimpleTable AWSTemplateFormatVersion: '2010-09-09' Resources: GetHtmlFunctionGetHtmlPermissionProd: Type: AWS::Lambda::Permission Properties: Action: lambda:invokeFunction Principal: apigateway.amazonaws.com FunctionName: Ref: GetHtmlFunction SourceArn: Fn::Sub: arn:aws:execute-api:${AWS::Region}: ${AWS::AccountId}:${ServerlessRestApi}/Prod/ ANY/* ServerlessRestApiProdStage: Type: AWS::ApiGateway::Stage Properties: DeploymentId: Ref: ServerlessRestApiDeployment RestApiId: Ref: ServerlessRestApi StageName: Prod ListTable: Type: AWS::DynamoDB::Table Properties: ProvisionedThroughput: WriteCapacityUnits: 5 ReadCapacityUnits: 5 AttributeDefinitions: - AttributeName: id AttributeType: S KeySchema: - KeyType: HASH AttributeName: id GetHtmlFunction: Type: AWS::Lambda::Function Properties: Handler: index.gethtml Code: S3Bucket: flourish-demo-bucket S3Key: todo_list.zip Role: Fn::GetAtt: - GetHtmlFunctionRole - Arn Runtime: nodejs4.3 GetHtmlFunctionRole: Type: AWS::IAM::Role Properties: ManagedPolicyArns: - arn:aws:iam::aws:policy/ AmazonDynamoDBReadOnlyAccess - arn:aws:iam::aws:policy/service-role/ AWSLambdaBasicExecutionRole AssumeRolePolicyDocument: Version: '2012-10-17' Statement: - Action: - sts:AssumeRole Effect: Allow Principal: Service: - lambda.amazonaws.com ServerlessRestApiDeployment: Type: AWS::ApiGateway::Deployment Properties: RestApiId: Ref: ServerlessRestApi Description: 'RestApi deployment id: 127e3fb91142ab1ddc5f5446adb094442581a 90d' StageName: Stage GetHtmlFunctionGetHtmlPermissionTest: Type: AWS::Lambda::Permission Properties: Action: lambda:invokeFunction Principal: apigateway.amazonaws.com FunctionName: Ref: GetHtmlFunction SourceArn: Fn::Sub: arn:aws:execute-api:${AWS::Region}: ${AWS::AccountId}:${ServerlessRestApi}/*/ ANY/* ServerlessRestApi: Type: AWS::ApiGateway::RestApi Properties: Body: info: version: '1.0' title: Ref: AWS::StackName paths: "/{proxy+}": x-amazon-apigateway-any-method: x-amazon-apigateway-integration: httpMethod: ANY type: aws_proxy uri: Fn::Sub: arn:aws:apigateway:$ {AWS::Region}:lambda:path/2015-03- 31/functions/${GetHtmlFunction.Arn}/ invocations responses: {} swagger: '2.0' AWS Serverless Application Model REPLACES:
  • 27. SAM: Open Specification Apache 2.0 licensed GitHub project New https://github.com/ awslabs/serverless- application-model
  • 30. The only Lambda book you need to read Written by AWS Technical Evangelist Danilo Poccia Just released! https://www.amazon.com/Aws-Lambda-Action- Event-driven-Applications/dp/1617293717/
  • 31. New Lambda videos from re:Invent 2016 AWS re:Invent 2016: What’s New with AWS Lambda (SVR202) https://www.youtube.com/watch?v=CwxWhyGteNc AWS re:Invent 2016: Serverless Apps with AWS Step Functions (SVR201) https://www.youtube.com/watch?v=75MRve4nv8s AWS re:Invent 2016: Real-time Data Processing Using AWS Lambda (SVR301) https://www.youtube.com/watch?v=VFLKOy4GKXQ AWS re:Invent 2016: Serverless Architectural Patterns and Best Practices (ARC402) https://www.youtube.com/watch?v=b7UMoc1iUYw ‪AWS re:Invent 2016: Bringing AWS Lambda to the Edge (CTD206)‬ https://www.youtube.com/watch?v=j26novaqF6M ‪AWS re:Invent 2016: Ubiquitous Computing with Greengrass (IOT201)‬ https://www.youtube.com/watch?v=XQQjX8GTEko
  • 32. AWS User Groups Lille Paris Rennes Nantes Bordeaux Lyon Montpellier Toulouse Côte d’Azur (soon!) facebook.com/groups/AWSFrance/ @aws_actus
  • 33. Merci ! Julien Simon Principal Technical Evangelist, AWS julsimon@amazon.fr @julsimon