How To Resume a Step Function From a Failed State **NEW FEATURE**

Поделиться
HTML-код
  • Опубликовано: 19 ноя 2023
  • AWS just released a brand new feature allowing you to re-drive your Step Function state-machine from a specific failed state instead of restarting your entire state machine. Learn how to use this new feature in this tutorial video.
    Sign up for my Newsletter to receive regular AWS updates AND get a FREE PDF that includes 5 AWS Project Ideas: beabetterdev.com/aws-project-...
    📚 My Courses 📚
    AWS Learning Accelerator - Learn AWS Through a Hands On Project - courses.beabetterdev.com/cour...
    AWS Step Functions Masterclass - courses.beabetterdev.com/cour...
    AWS Lambda - A Practical Guide - www.udemy.com/course/aws-lamb...
    🎉SUPPORT BE A BETTER DEV🎉
    Become a Patron: / beabetterdev
    📚 INCREDIBLE BOOKS TO BUILD YOUR ABILITY TO FOCUS AND ORGANIZE 📚
    Deep Work - amzn.to/463oPRk
    So Good They Can't Ignore You - amzn.to/3PPo48N
    Digital Minimalism - amzn.to/3Q00nep
    A World Without Email - amzn.to/3t6nGKq
    Time Block Planner - amzn.to/44Z9nEI
    📚 MY RECOMMENDED READING LIST FOR SOFTWARE DEVELOPERS📚
    Clean Code - amzn.to/37T7xdP
    Clean Architecture - amzn.to/3sCEGCe
    Head First Design Patterns - amzn.to/37WXAMy
    Domain Driven Design - amzn.to/3aWSW2W
    Code Complete - amzn.to/3ksQDrB
    The Pragmatic Programmer - amzn.to/3uH4kaQ
    Algorithms - amzn.to/3syvyP5
    Working Effectively with Legacy Code - amzn.to/3kvMza7
    Refactoring - amzn.to/3r6FQ8U
    🎙 MY RECORDING EQUIPMENT 🎙
    Shure SM58 Microphone - amzn.to/3r5Hrf9
    Behringer UM2 Audio Interface - amzn.to/2MuEllM
    XLR Cable - amzn.to/3uGyZFx
    Acoustic Sound Absorbing Foam Panels - amzn.to/3ktIrY6
    Desk Microphone Mount - amzn.to/3qXMVIO
    Logitech C920s Webcam - amzn.to/303zGu9
    Fujilm XS10 Camera - amzn.to/3uGa30E
    Fujifilm XF 35mm F2 Lens - amzn.to/3rentPe
    Neewer 2 Piece Studio Lights - amzn.to/3uyoa8p
    💻 MY DESKTOP EQUIPMENT 💻
    Dell 34 inch Ultrawide Monitor - amzn.to/2NJwph6
    Autonomous ErgoChair 2 - bit.ly/2YzomEm
    Autonomous SmartDesk 2 Standing Desk - bit.ly/2YzomEm
    MX Master 3 Productivity Mouse - amzn.to/3aYwKVZ
    Das Keyboard Prime 13 MX Brown Mechanical- amzn.to/3uH6VBF
    Veikk A15 Drawing Tablet - amzn.to/3uBRWsN
    🌎 Find me here:
    Twitter - / beabetterdevv
    Instagram - / beabetterdevv
    Patreon - Donations help fund additional content - / beabetterdev
    #SoftwareEngineer
    #SoftwareDeveloper

Комментарии • 10

  • @rc8839
    @rc8839 4 месяца назад

    Finally AWS provided this functionality which my trusty old IBM Mainframe Job Control language had for last 45+ years. Welcome to 21st century AWS.

  • @seawatts12
    @seawatts12 7 месяцев назад +2

    THIS IS HUGE!!! Wow… the amount of code I’ve written to be able to retry my failed executions…

  • @gregf9160
    @gregf9160 7 месяцев назад

    Thanks again, Daniel 🤗 😍

  • @philn9205
    @philn9205 7 месяцев назад

    hi, great content, i really enjoy your channel. could you do a video or refererence content about step function parallel state. I'm sure it's a no brainer, but i think nice to have

  • @rc8839
    @rc8839 4 месяца назад

    There is still one major issue with this redrive feature in that it does not pick up the fixed lambda code, it still runs the old version that failed.

  • @McCheesyNipples
    @McCheesyNipples 7 месяцев назад +1

    Can this be done programmatically?

    • @FarsansTorraOrdvitsar
      @FarsansTorraOrdvitsar 5 месяцев назад

      Yes:
      import boto3
      import os
      client = boto3.client('stepfunctions')
      def rerun_failed_step(amount_to_retry):
      state_machine_arn = os.getenv('STEP_FUNCTION_ARN') # arn to failing state machine
      failed_executions = client.list_executions(
      stateMachineArn=state_machine_arn, statusFilter="FAILED", maxResults=amount_to_retry) # list nth number of failed executions
      for execution in failed_executions['executions']:
      redrive_execution(execution["executionArn"])
      def redrive_execution(execution_arn):
      # Redrive the failed execution:
      client.redrive_execution(
      executionArn=execution_arn
      )
      if _name_ == '__main__':
      rerun_failed_step(10) # rerun 10 failed step executions

  • @FarsansTorraOrdvitsar
    @FarsansTorraOrdvitsar 5 месяцев назад

    How to do it with python and boto3?

    • @FarsansTorraOrdvitsar
      @FarsansTorraOrdvitsar 5 месяцев назад

      Answer to my own question:
      import boto3
      import os
      client = boto3.client('stepfunctions')
      def rerun_failed_step(amount_to_retry):
      state_machine_arn = os.getenv('STEP_FUNCTION_ARN') # arn to failing state machine
      failed_executions = client.list_executions(
      stateMachineArn=state_machine_arn, statusFilter="FAILED", maxResults=amount_to_retry) # list nth number of failed executions
      for execution in failed_executions['executions']:
      redrive_execution(execution["executionArn"])
      def redrive_execution(execution_arn):
      # Redrive the failed execution:
      client.redrive_execution(
      executionArn=execution_arn
      )
      if __name__ == '__main__':
      rerun_failed_step(10) # rerun 10 failed step executions