© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Boaz Ziniman, Technical Evangelist, AWS
CI/CD for AWS Lambda Projects
IsraelCloud User Group – January 2018
@ziniman
boaz.ziniman.aws
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
About me
• Technical Evangelist at AWS
• Events & Meetsup
• Webinars
• Blogs
• Com2bb.munity
• Social Media
• A long history of Web Development, IT and Operations
• AWS Customer since 2009
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
- Intro
- Dev iteration loop
- Author (application and code)
- Test
- Debug
- Serverless Deployments
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless applications
ANYTHING
Changes in
data state
Requests to
endpoints
Changes in
resource state
EVENT SOURCE FUNCTION
Node.js
Python
Java
C#
Go
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless means…
No servers to provision
or manage
Scales with usage
Never pay for idle Availability and fault
tolerance built in
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
FINRA
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ALM for serverless applications
Author Build Test DeployDebugTest
CI/CD
Source
Author/test/debug
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Author/test/debug
Author Test Debug
Simple app
No team members
No code repo
What if:
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
New and improved Lambda console
• Cloud9 editor within the Lambda console
• Function graph
• Persisted test events
• Monitoring view (jump to logs for any timeframe)
New
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Author/Test/Debug cycle
Author
C o d e A p p l i c a t i o n
Test Debug
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Meet
SAM!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Serverless Application Model (SAM)
• CloudFormation extension optimized for serverless
• New serverless resource types: functions, APIs, and tables
• Supports anything CloudFormation supports
• Open specification (Apache 2.0)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudFormation
• Provision and manage a collection of related AWS resources.
• Your application = CloudFormation stack
• Input .yaml file and output provisioned AWS resources
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
C o d eA p p l i c a t i o n
Test Debug
Author/Test/Debug cycle
Wait, what about test
and debug?
AuthorAuthor
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Testing serverless apps - challenges
- Test in an environment that resembles Lambda:
- OS
- Libraries
- Runtime
- Configured limits (memory, timeout)
- Mimic response and log outputs
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Testing serverless apps - challenges
- Test events need to be:
- Syntactically accurate
- Different for each trigger
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Introducing SAM Local
CLI tool for local testing of serverless apps
Leverages Docker images to mimic Lambda’s
execution environment
Emulates Lambda functions and APIs
Event generator to help you generate event
payload for common Lambda triggers
sam local generate-event s3 --bucket <bucket> --key <key>
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Introducing SAM Local
Response object and function logs available on
your local machine
Supports live debugging
Currently supports Java, Node.js and Python
SAM Local is open source & accepting pull
requests!
https://github.com/awslabs/aws-sam-local
npm install –g aws-sam-local
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Cloud9
• Cloud-based dev environment
• Write, test and debug with just a browser
• Optimized for serverless
New
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Author
C o d eA p p l i c a t i o n
Test Debug
Author/Test/Debug cycle
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
</>
GitHub
Amazon S3
AWS CodeCommit
AWS CodeBuild AWS CodeBuild
Third-party tools
AWS CloudFormation
Source Build Test Deploy
Deploying serverless applications
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo App – RateMyTalk Chatbot
AWS LambdaAWS Lex
Amazon DynamoDB
Amazon ES
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo App – RateMyTalk Chatbot
AWS CodeDeployAWS CodeBuild
AWS CodePipeline
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo App – RateMyTalk Chatbot
AWS
CodeDeploy
AWS
CodeBuild
AWS
CodePipeline
AWS CodeStar
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
https://aws.amazon.com/serverless/developer-tools/
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Feedback
Rate talk (CI/CD for AWS Lambda Projects)
boaz.ziniman.aws
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thanks!
Boaz Ziniman, Technical Evangelist, AWS
@ziniman
boaz.ziniman.aws

CI/CD for AWS Lambda Projects - IsraelCloud Meetup

  • 1.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Boaz Ziniman, Technical Evangelist, AWS CI/CD for AWS Lambda Projects IsraelCloud User Group – January 2018 @ziniman boaz.ziniman.aws
  • 2.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. About me • Technical Evangelist at AWS • Events & Meetsup • Webinars • Blogs • Com2bb.munity • Social Media • A long history of Web Development, IT and Operations • AWS Customer since 2009
  • 3.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Agenda - Intro - Dev iteration loop - Author (application and code) - Test - Debug - Serverless Deployments
  • 4.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Serverless applications ANYTHING Changes in data state Requests to endpoints Changes in resource state EVENT SOURCE FUNCTION Node.js Python Java C# Go
  • 5.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Serverless means… No servers to provision or manage Scales with usage Never pay for idle Availability and fault tolerance built in
  • 6.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. FINRA
  • 7.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. ALM for serverless applications Author Build Test DeployDebugTest CI/CD Source Author/test/debug
  • 8.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Author/test/debug Author Test Debug Simple app No team members No code repo What if:
  • 9.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. New and improved Lambda console • Cloud9 editor within the Lambda console • Function graph • Persisted test events • Monitoring view (jump to logs for any timeframe) New
  • 10.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Author/Test/Debug cycle Author C o d e A p p l i c a t i o n Test Debug
  • 11.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Meet SAM!
  • 12.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Serverless Application Model (SAM) • CloudFormation extension optimized for serverless • New serverless resource types: functions, APIs, and tables • Supports anything CloudFormation supports • Open specification (Apache 2.0)
  • 13.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. CloudFormation • Provision and manage a collection of related AWS resources. • Your application = CloudFormation stack • Input .yaml file and output provisioned AWS resources
  • 14.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. C o d eA p p l i c a t i o n Test Debug Author/Test/Debug cycle Wait, what about test and debug? AuthorAuthor
  • 15.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Testing serverless apps - challenges - Test in an environment that resembles Lambda: - OS - Libraries - Runtime - Configured limits (memory, timeout) - Mimic response and log outputs
  • 16.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Testing serverless apps - challenges - Test events need to be: - Syntactically accurate - Different for each trigger
  • 17.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Introducing SAM Local CLI tool for local testing of serverless apps Leverages Docker images to mimic Lambda’s execution environment Emulates Lambda functions and APIs Event generator to help you generate event payload for common Lambda triggers sam local generate-event s3 --bucket <bucket> --key <key>
  • 18.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Introducing SAM Local Response object and function logs available on your local machine Supports live debugging Currently supports Java, Node.js and Python SAM Local is open source & accepting pull requests! https://github.com/awslabs/aws-sam-local npm install –g aws-sam-local
  • 19.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWS Cloud9 • Cloud-based dev environment • Write, test and debug with just a browser • Optimized for serverless New
  • 20.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Author C o d eA p p l i c a t i o n Test Debug Author/Test/Debug cycle
  • 21.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. </> GitHub Amazon S3 AWS CodeCommit AWS CodeBuild AWS CodeBuild Third-party tools AWS CloudFormation Source Build Test Deploy Deploying serverless applications
  • 22.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Demo App – RateMyTalk Chatbot AWS LambdaAWS Lex Amazon DynamoDB Amazon ES
  • 23.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Demo App – RateMyTalk Chatbot AWS CodeDeployAWS CodeBuild AWS CodePipeline
  • 24.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Demo App – RateMyTalk Chatbot AWS CodeDeploy AWS CodeBuild AWS CodePipeline AWS CodeStar
  • 25.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Demo
  • 26.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. https://aws.amazon.com/serverless/developer-tools/
  • 27.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Feedback Rate talk (CI/CD for AWS Lambda Projects) boaz.ziniman.aws
  • 28.
    © 2018, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Thanks! Boaz Ziniman, Technical Evangelist, AWS @ziniman boaz.ziniman.aws