How aws-samples/asynchronous-event-processing-api-gateway-sqs-cdk works
This sample deploys an authenticated jobs API for asynchronous work: a POST accepts job parameters and returns an identifier; a Fargate worker processes the queued job and stores its result; a GET retrieves it. Failed messages take a recovery path through a dead-letter queue and Lambda, which stores failure parameters for retrieval. The graph includes the CDK stack and construct definitions as the internal deployment layer. Runtime relationships follow the README and shown excerpts; the EventBridge archive/replay capability is documented but its wiring is not shown in the sampled source.
Main entry points: infrastructure/main.py Infrastructure stack · jobs_api/main.py Jobs API · event_processing/main.py Jobs queue · error_handling/main.py Error handler
Components 13
Jobs API
- Jobs API
infrastructure/jobs_api/main.py
Async Processing
- Jobs queue
infrastructure/event_processing/main.py - Fargate worker
infrastructure/event_processing/main.py - Job processing
event_processing/main.py - Jobs table
infrastructure/event_processing/main.py
Failure Recovery
- Dead-letter queue
infrastructure/event_processing/main.py - EventBridge
- Error handler
error_handling/main.py - Event archive
CDK Deployment
- Infrastructure stack
infrastructure/main.py - Processing construct
infrastructure/event_processing/main.py - API construct
infrastructure/jobs_api/main.py
Other components
- Authorized user
Connections 18
- Authorized user → Jobs API: submits jobs
README.md - Jobs API → Jobs queue: enqueues parameters
infrastructure/jobs_api/main.py - Jobs queue → Fargate worker: feeds messages
infrastructure/event_processing/main.py - Fargate worker → Job processing: runs
infrastructure/event_processing/main.py - Job processing → Jobs table: writes results
event_processing/main.py - Authorized user → Jobs API: requests results
README.md - Jobs API → Jobs table: queries job
infrastructure/jobs_api/main.py - Jobs queue → Dead-letter queue: routes failures
infrastructure/event_processing/main.py - Dead-letter queue → Error handler: triggers
infrastructure/event_processing/main.py - EventBridge → Error handler: triggers
README.md - Error handler → Jobs table: writes failure data
error_handling/main.py - Error handler → Event archive: archives failures
README.md - Authorized user → Event archive: replays events
README.md - Infrastructure stack → Processing construct: creates
infrastructure/main.py - Infrastructure stack → API construct: creates
infrastructure/main.py - Infrastructure stack → Jobs API: configures routes
infrastructure/main.py - Infrastructure stack → Jobs queue: grants send access
infrastructure/main.py - Infrastructure stack → Jobs table: grants read access
infrastructure/main.py