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

Serverless Workflows with AWS Step Functions

Serverless Workflows with AWS Step Functions

AWS Lambda is stateless, and the execution duration is limited to 15 minutes. So how to implement and coordinate workflows? AWS Step Functions enables you to orchestrate the components of distributed applications.

This talk introduces AWS Step Functions. On top of that, the talk shows some real-world use cases.

E8f66870d1204779ecc45f2695faa73e?s=128

Michael Wittig

June 13, 2019
Tweet

Transcript

  1. Introducing AWS Step Functions

  2. Hello! I am Michael Wittig. AWS since 2013. Freelancer. Everything

    Cloud and DevOps. 3
  3. • Covers fundamental parts of AWS: EC2, EBS, EFS, S3,

    RDS, DynamoDB, Lambda, VPC, IAM, Auto Scaling, ELB, … • Learn how to build scalable, highly available, or even fault tolerant systems • Focuses on Infrastructure as Code with CloudFormation manning.com or Amazon Book Amazon Web Services in Action 4
  4. • Running your web application on AWS with Docker: ECS

    and Fargate. • Simple to use and fast to implement! • A production-ready infrastructure for everyone. • Including deployment pipeline and Infrastructure as Code. cloudonaut.io/rapid-docker-on-aws/ Book Rapid Docker on AWS 5
  5. “ AWS Step Functions is a web service that enables

    you to coordinate the components of distributed applications and microservices using visual workflows. https:/ /docs.aws.amazon.com/step-functions/latest/dg/welcome.html 2
  6. • Business Process (Onboarding New Customers, …) • Execute a

    container in Fargate • Infrastructure Automation (CloudFormation Drift Detection, …) • Customize Deployment Workflow (ECS Deployment, …) • ... Use Cases 3
  7. Anatomy Of a State Machine

  8. 5 Wait Task

  9. 6 Choice Task Succeed

  10. 7

  11. • Task • Choice • Fail / Succeed • Pass

    • Wait • Parallel State Types 8
  12. Task Integrations • Activity / worker • AWS Lambda •

    AWS Batch • Amazon DynamoDB • Amazon ECS 9 • Amazon SNS • Amazon SQS • AWS Glue • Amazon SageMaker • External Input
  13. Error Handling • Retry • Catch 10

  14. 11 Demo https:/ /github.com/michaelwittig/aws-ugs-june2019

  15. Amazon States Language 12 { "Comment": "An example of the

    Amazon States Language using a choice state.", "StartAt": "FirstState", "States": { "FirstState": { "Type": "Task", "Resource": "arn:aws:lambda:us-east-1:123456789012:function:FUNCTION_NAME", "Next": "ChoiceState" }, "ChoiceState": { "Type" : "Choice", "Choices": [{ "Variable": "$.foo", "NumericEquals": 1, "Next": "FirstMatchState" }], "Default": "DefaultState" }}}
  16. “ Use Step Functions whenever a Lambda function needs to

    wait/poll longer than 15 minutes in the worst case. 13
  17. Blog cloudonaut.io 6