Add Step Functions state machine for async processing; various fixes in setup#6
Merged
Add Step Functions state machine for async processing; various fixes in setup#6
Conversation
Member
whummer
commented
Apr 18, 2026
- add Step Functions state machine for async processing
- enhance workshop demo application logic
- various fixes in setup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tches boto3 Setting localhost:4566 inside Lambda containers breaks service calls since localhost resolves to the container itself, not LocalStack. Removing the override lets LocalStack inject the correct endpoint automatically. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…laced Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DynamoDB returns numeric fields as Decimal; use a custom JSONEncoder to convert them to int before serializing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- order_processor now starts a Step Functions execution when triggered
by SQS, and handles individual steps (validate, process_payment,
fulfill, handle_failure) when invoked by the state machine
- State machine: ValidateOrder → wait 3s → ProcessPayment → wait 3s →
FulfillOrder, with HandleFailure catch on all steps
- DDB status transitions: pending → validating → payment_processing →
fulfilled (or failed)
- order_handler: add created_at timestamp to each order
- UI: add Created column, pipeline progress indicator per order, updated
status badges for all new states; sort orders newest-first
- main.tf: remove redundant endpoints{} block (tflocal handles this),
add SFN state machine + IAM role, STATE_MACHINE_ARN env var
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
aws_lambda_function.order_processor and aws_sfn_state_machine.order_processing mutually reference each other. Break the cycle by constructing the ARN from aws_caller_identity + aws_region data sources instead of the resource itself. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…h auto-refresh - order_processor: add sleep() calls per step to simulate processing time - order_processor: write step timestamps (validating_at, payment_at, etc.) to DDB - index.html: expandable rows showing full order ID and step timestamps - index.html: auto-refresh (3s) only while orders are in non-terminal status Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
9c5d4c9 to
21fc142
Compare
Default 3s timeout was too short for steps with sleep() calls. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
54ce591 to
62ff150
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
62ff150 to
b32820f
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- replay_dlq.py: handle empty stdout from receive-message (empty DLQ) - index.html: poll /_localstack/chaos/faults every 5s, show warning banner with active fault details when chaos mode is enabled Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Appending a short random suffix allows retried orders to start a fresh execution without hitting ExecutionAlreadyExists. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Without this, the SQS consumer Lambda always succeeded (SFN is async), so DDB throttle errors never caused SQS retries or DLQ delivery. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- order_handler: add POST /orders/replay endpoint to drain DLQ - terraform: add ORDERS_DLQ_URL env var and /orders/replay API GW route - index.html: checkbox to poll /replay every 5s, flashes count on replay - index.html: detail rows now show step description alongside timestamp Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Left nav: Orders / About sections - Right sidebar: chaos mode toggle, DLQ auto-resume, API endpoint - About section: architecture diagram, service breakdown, chaos walkthrough - Chaos mode toggle directly calls LocalStack chaos API from the browser Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
depends_on alone doesn't redeploy the stage when new resources are added. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…+ dropdown - terraform: products table with 6 pre-seeded LocalStack swag items - order_handler: GET /products endpoint - index.html: Products nav section with table; order form uses product dropdown - index.html: fulfilled orders show S3 receipt download link in detail row Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.