Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Baltimore DevOps - Orchestrating Serverless with AWS Step Functions

Matt Williams
September 12, 2018

Baltimore DevOps - Orchestrating Serverless with AWS Step Functions

OK, you have built your first Lambda function. It may even be useful (and not just a thumbnail generator). But an application is more than a single function; you need a lot of them. How do you get your functions working together? In this introduction Matt Williams will get you started with Step Functions and show you how easy it is to use them to orchestrate AWS Lambda.

Matt Williams

September 12, 2018
Tweet

More Decks by Matt Williams

Other Decks in Programming

Transcript

  1. matt williams - @technovangelist Baltimore DevOps Who am I Matt

    Williams Evangelist at Datadog [email protected] TW: technovangelist YT: technovangelist IG/GH/XYZ: technovangelist Organizer of: DevOps Days Boston 2017 & 2018 Serverless Days Boston 2018
  2. matt williams - @technovangelist Baltimore DevOps Who is Datadog SaaS-based

    Monitoring & Analytics Infrastructure, APM, Logs Open Source Agent Trillions of data points per day We are hiring!!
  3. © 2017, Amazon Web Services, Inc. or its Affiliates. All

    rights reserved. I like to talk about Serverless…
  4. matt williams - @technovangelist Baltimore DevOps What is AWS Lambda

    Its all about the function Serverless As far as you are concerned Don’t pay for idle Scale with ease FaaS Node 8.10/6.10, Golang, C# 1/2/2.1, Python 2.7/3.6, Java8 Trigger-based
  5. matt williams - @technovangelist Baltimore DevOps Trigger Based? S3 DynamoDB

    Kinesis SNS SES Cognito CloudFormation Cloudwatch Logs & Events CodeCommit Config Alexa Lex API Gateway IoT CloudFront Lambda http://tvl.st/khvid
  6. matt williams - @technovangelist Baltimore DevOps That’s pretty cool right?

    But not perfect You still have to configure everything else S3 DynamoDB API Gateway etc SAM Cloudformation Serverless
  7. matt williams - @technovangelist Baltimore DevOps we can create many

    serverless functions but how do we orchestrate them?
  8. matt williams - @technovangelist Baltimore DevOps Step Function Concepts State

    Machine States Task Choice Succeed/Fail Pass Wait Parallel Transitions Executions You define the State Machine with the Amazon States Language A diagram will be generated based on that structure
  9. matt williams - @technovangelist Baltimore DevOps Many ways to build

    AWS Step Functions I used Serverless Framework (http://tvl.st/sls)
  10. matt williams - @technovangelist Baltimore DevOps Benefits of Serverless Framework

    Define everything in a single file: IAM Role Statements Function Handlers Function Triggers State Machine States AWS CloudFormation for other things
  11. matt williams - @technovangelist Baltimore DevOps Amazon ECR AWS Lambda

    Amazon S3 Amazon DynamoDB Amazon CloudFront AWS CodeBuild AWS CodeCommit AWS CloudFormation IAM Amazon API Gateway* AWS Step Functions Amazon SNS
  12. matt williams - @technovangelist Baltimore DevOps 1.Use ML to figure

    out which slide 2.Is this slide different than the last time? 3.If so, pull slide data from Dynamo 4.If slide different then create document in s3 5.Build the site 6.Wait for it 1.Is it built 7.Done
  13. matt williams - @technovangelist Baltimore DevOps How about monitoring? We

    monitor serverless via Logs MONITORING|unix_epoch_timestamp|value|count| my.metric.name|#tag1:value,tag2 console.log(monitoringstring);
  14. matt williams - @technovangelist Baltimore DevOps What are the AWS

    Lambda Metrics aws.lambda.duration, min, max, sum aws.lambda.errors aws.lambda.invocations aws.lambda.throttles aws.lambda.iterator_age
  15. matt williams - @technovangelist Baltimore DevOps What are the AWS

    Step Function Metrics aws.states.execution_time (.maximum, .minimum) aws.states.executions_aborted, failed, started, succeeded, timed_out aws.states.lambda_functions_scheduled, started, succeeded, timed_out aws.states.execution_throttled aws.states.lambda_function_time (.maximum, .minimum) aws.states.lambda_function_run_time (.maximum, .minimum) aws.states.lambda_function_schedule_time (.maximum, .minimum) aws.states.lambda_functions_started
  16. matt williams - @technovangelist Baltimore DevOps AWS Lambda and AWS

    Step Function Challenges • Logging and debugging • Don’t trust any function when it claims a step is complete • Cold start depends on your use case • Every function should do one thing…but granularity depends
  17. matt williams - @technovangelist Baltimore DevOps Matt Williams Evangelist at

    Datadog [email protected] all the socials: technovangelist Organizer of DevOps Days Boston 2017 & 2018