AWS User Group Presentation
Hosted by PolarSeven - http://polarseven.com
Session 2: Presentation
Erwan Alliaume & Alexandre Gindre
AWS Lambda, tooling and deployment at scale
Lambdas technology is the new hype brought by Amazon as a possible answer for the serverless approach. We don’t deny the usages for this technology but does this technology have enough tools for software development standards? Can we rely on some of them to reach the enterprise’s delivery standards? Is there a tool to rule them all? In this talk, we will walk through the use cases and the tools available to develop/manage lambdas
2. WHO ARE WE? 2
Erwan Alliaume Alexandre Gindre
Chief Technical Officer Consultant
3. AGENDA 3
What is a lambda? Examples and demos
Not true unfortunately … we have only 20
minutes
But materials will be shared in the slide deck
1. AWS Lambda overview
2. AWS Compute offering
3. Use cases
4. Framework Landscape
5. Why do you need a framework
1. AWS Lambda Web Console
2. AWS Lambda CLI
3. AWS Cloud Formation for AWS
Lambda
4. Jenkins Lambda Plugin
5. Gordon framework
6. Serverless framework
21
5. WHAT IS A LAMBDA? 5
AWS Lambda is a serverless compute service that runs your code in response to events
and automatically manages the underlying compute resources for you
Event
From an AWS service event To anything (not only AWS)
austoscale
Trigger
Asynchronous function
event driven
Any behaviour
6. AWS COMPUTE OFFERINGS 6
Pricing: cheap!
#requests , execution time , memory
First million call free, $0.20usd per million over
¤ Containers
> Deploy in seconds
> Live for hours
¤ Serverless compute platform
> Deploy in milliseconds
> Live for seconds
Granularity
AWS EC2
AWS ECS
AWS Lambda
¤ Virtual servers
> Deploy in minutes
> Live for weeks
7. USE CASES 7
¤ Auto Start / Auto Stop of EC2 instances
¤ AWS inventory, and clean-up suggestion
¤ Slack bot, via API Gateway and push
hooks
¤ Time based notifications: mail, slack…
¤ CV/Resume transfer to our HR tool
¤ …
At
¤ Airline: SNS to S3 to topic backup
¤ … and replay them for testing
purpose
¤ 100 invocations by second
¤ Bank: Copy user form data from s3 to a
homemade analytics tool
Deployed for our clients
¤ Heroku like paas
¤ s3 code => deploy ECS or EC2
¤ Mutli region autodeployer
¤ s3 region1 => s3 region2 => deploy
¤ CI/CD or load testing pipeline
Other examples
¤ Dynamic data ingestion
¤ Image processing, transcoding
¤ Event stream processing
¤ Serverless http backends (microservices)
¤ Database triggers
¤ AWS services plumbing
Generic usages
8. FRAMEWORKS LANDSCAPE
OCTO TECHNOLOGY >
8
Build, package and deploy – CLI and generic tools
Nodejs microservices
Actor driven nodejs app
JavaScript APIs with
AWS API Gateway and Lambda
CLI to deploy, update, and test functionscreate, wire and deploy AWS Lambdas
using CloudFormation
serverless architectures on AWS Lambda,
Azure Functions, Google Cloud Functions
Serverless Python Web Services
with AWS Lambda + API Gateway
Develop and deploy serverless
Python in AWS Lambda
AWS Lambda automation
and integration for Python
Python serverless microframework
from Amazon for AWS lambda
AWS Lambda manager
with Golang support
A Go framework for
AWS Lambda microservices
.Net, Javascript, Java, Scala,
Ruby, and Python lambdas
Build serverless REST API's
with JAVA with JAX-RS
AWS Lambda functions
using Apache Maven and Java
9. WHY DO YOU NEED A FRAMEWORK?
OCTO TECHNOLOGY >
9ProvidedbyAWSUptoyou!
New Runtime? You need a new CI/CD process!
10. AWS LAMBDA, THE OTHER SIDE OF THE COIN 10
Missing
on the AWS Picture…
AWS Lambda
Awesomeness!
¤ Simple to learn
¤ Event driven
¤ Ideal for simple stateless process
¤ Cheap!
¤ Fully managed (including monitoring/logging)
¤ Packaging is up to you
¤ Versioning is up to you
¤ Configuration variables are not so easy
¤ Not multi-env friendly {dev, test, preprod, prod}
¤ Error handling is hard
Need to design your { process , tools , pipeline } to use them in a company context level!
12. THE AWS LAMBDA WEB CONSOLE
OCTO TECHNOLOGY >
12
ConsPros
¤ Simple to learn and use
¤ Templates of code and role
¤ Code directly in the console or use zip file
¤ Provides information on other AWS services
¤ S3, VPC, Security Groups
¤ Not automatic
¤ Packaging is up to you
¤ No variable by environment
¤ Versioning is up to you
¤ Naming strategy
¤ Via Alias or version
¤ Code directly in the console
¤ Impossible to see the content of a ZIP file
¤ Manual testing
13. THE AWS LAMBDA CLI 13
ConsPros
¤ Well documented, easy to learn
¤ Same than the console, but scriptable
¤ CLI completion possible
¤ Flexible, you have all AWS capabilities
available from the CLI
¤ Same than the console, only low level operations
¤ Packaging is up to you
¤ Versioning is up to you
¤ Multi-env is complicated
¤ Code sharing is complicated
¤ Testing is complicated
¤ CI integration is up to you
aws lambda create-function --function-name my-lambda --zip-file fileb://file-path/my-lambda.zip
--role role-arn –handler mylambda.handler --runtime nodejs4.3
aws lambda invoke --invocation-type RequestResponse --function-name my-lambda --payload file://file-path/input.txt outputfile.txt
14. AWS CLOUDFORMATION
OCTO TECHNOLOGY >
14
ConsPros
¤ AWS Standard
¤ Everything at the same place
¤ Lambda, Role, Triggers, Destination
¤ Easy cleanup and update
¤ Parameterisable
¤ Code inline or ZIP in s3
¤ Reusable!
¤ Packaging is up to you
¤ If packaging ZIP, hard to variabilize the content
¤ Some triggers are complicated to setup
¤ Topic subscription
¤ Versioning is up to you
¤ Naming strategy
¤ Manual testing
¤ Large ugly JSON file
15. THE JENKINS AWS LAMBDA PLUGIN 15
https://wiki.jenkins-ci.org/display/JENKINS/AWS+Lambda+Plugin
ConsPros
¤ Integration to Jenkins, a CI/CD solution
¤ Wrapper of the AWS CLI
¤ 1-click Lambda deploy
¤ Integration test via, invoke the deployed lambda
¤ Packaging is still up to you
¤ Multi-env still complicated
¤ No variable / parameters
¤ Versioning is up to you
¤ via a naming strategy
¤ Only basics operations available…
16. GORDON
OCTO TECHNOLOGY >
16
ConsPros
¤ Easy to use
¤ Easily to manage the code with versioning tool
¤ Manage different environments
¤ Config files
¤ CLI to deploy
¤ Generated cloud formation script
¤ Support Golang
¤ Multi-region
¤ Very intrusive
¤ Use mandatory lambda ”libs”
¤ Use too permissive role
¤ Still has some bug with variables injection
¤ Doesn't have lambda level of granularity
¤ Generated cloud formation
17. OCTO TECHNOLOGY >
17SERVERLESS FRAMEWORK
https://github.com/serverless/serverless
ConsPros
¤ One of the most advanced tool around lambdas
¤ Less intrusive than Gordon
¤ Code reusable across several lambdas
¤ Multi-Env, yaml configuration
¤ Moving/growing very fast
¤ 10k+ stars on github
¤ Simple: create / deploy / invoke, cloudformation based
¤ Multi-Regions
¤ Testable
¤ Still buggy! Very young!
¤ Variables not available everywhere
¤ Cloud agnostic … on the paper at least J
19. CONCLUSION, TAKE AWAY 19
¤ Packaging, deploying and maintaining AWS Lambda is complex
¤ You need to build your CI/CD tools and process around the AWS
Lambda Runtime
¤ Frameworks can help, but the are still very young!
¤ May be less risky to use low level tools (AWS CLI)?!...
¤ … frameworks are evolving very fast
Young!Need tools!