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

Effective AWS Step Functions

Effective AWS Step Functions

haruharuharuby

September 10, 2022
Tweet

More Decks by haruharuharuby

Other Decks in Technology

Transcript

  1. Effective Step Functions
    Tomoharu Ito
    https://hugtech.io

    View Slide

  2. Agenda
    1. Lambda invoking is often bad.
    2. The new process with WorkflowStudio
    3. Point of view for variable injection in CI/CD
    4. Design Patterns
    5. Use case (Shifter, SAML integration workflow)

    View Slide

  3. 1. Lambda invoking is often bad.

    View Slide

  4. 1. [Problem] sometimes hard to see your logic.
    packed in..
    - Transcribe:StartBatchJob
    - WaitJobComplete
    - SNS:Publish
    - SES:SendEmail
    - DynamoDB: UpdateItem
    :
    return
    FALLBACK?

    View Slide

  5. 1. [Solution] Extract Lambda by SDK integration

    View Slide

  6. Eliminate Lambda (as much as possible).
    Express (and don’t hide) your logic on your
    StateMachine.

    View Slide

  7. 2. The new process and benefit for WorkflowStudio
    Prototype first.
    Business logic first.

    View Slide

  8. 2. Circulation your workflow Console and Repository

    View Slide

  9. 2. Alteration ASL easy on the Workflow Studio (1)
    Handling all the exceptions.

    View Slide

  10. Output modification.
    2. Alteration ASL easy on the Workflow Studio (2)

    View Slide

  11. Don’t needed write ASL direct.
    Designing isolated In/Out.
    Mutually exclusive errors and fallbacks.

    View Slide

  12. 3. Point of view for variable injection in CI/CD

    View Slide

  13. 3. Pulling variables in the workflow
    SSM:GetParameters
    on top of Workflow.

    View Slide

  14. 3. Inject variables from AWS-SAM

    View Slide

  15. 3. [Recommended Way] Inject variables from AWS-SAM
    Reset injected values to
    inside Workflow as variables
    on top.

    View Slide

  16. Refer them as
    workflow parameters.
    3. [Recommended Way] Inject variables from AWS-SAM

    View Slide

  17. Manage credential on the single point.
    Dynamic or static more suitable in your
    use-case .

    View Slide

  18. 4. Design Patterns
    Exception
    Handler
    Catching all exceptions

    View Slide

  19. 4. Design Patterns
    Delaying operation in
    StateMachine.
    Delay

    View Slide

  20. 4. Design Patterns
    Run different operation
    depending on
    StateMachine input.
    Action &
    Choice

    View Slide

  21. 4. Design Patterns
    Avoid StateMachine
    Nesting with
    EventBridge.
    Flatten

    View Slide

  22. 4. Design Patterns
    Real time notification
    from StateMachine.
    Async
    Notification

    View Slide

  23. 5. Use case (Shifter, SAML integration workflow)

    View Slide

  24. Switch operation per phase in a workflow

    View Slide

  25. View Slide

  26. View Slide

  27. More traceability comes from SDK integration.

    View Slide

  28. Monitoring performance by default with X-Ray.

    View Slide

  29. Thanks for listening everyone.
    See you at the next meetup.

    View Slide