Skip to content

Lambda Handler

goldy4719 edited this page Apr 10, 2026 · 1 revision

Overview:

The Lambda handler processes uploaded images by invoking Rekognition, applying the shared parser, and returning normalized tag data. It serves as the production execution point within the backend pipeline.

Prerequisites:

  • Shared parser module
  • Defined Lambda event contract
  • Permissions for Rekognition, S3, and optional DynamoDB writes
  • Environment variables for runtime configuration

Implementation/Steps

  1. The system receives an event and extracts the S3 bucket and key.
  2. The system invokes detect_labels using the image reference.
  3. The system passes the raw response into the shared parser.
  4. The system logs structured metadata including request ID, bucket, key, and tag count.
  5. The system returns normalized tags according to the defined contract.
  6. The system handles both S3-triggered and direct invocation events within a unified flow.

Key Takeaways

  • The Lambda reuses shared parsing logic without duplication.
  • Event normalization ensures consistent processing paths.
  • Structured logging supports traceability.
  • Output strictly follows the defined contract.

Clone this wiki locally