Function reference
get_rental_invoice is deployed and reachable at GET /v1/invoices/{type}/{invoice_id} but is not currently called by the iOS app.Lambda layers
Shared dependencies are distributed as Lambda layers so each function only packages its own logic.utils-layer
The common utilities layer contains all shared Python modules used across multiple functions:
To update the layer, regenerate
lambda_layers/common/utils_layer.zip and run terraform apply.
pyjwt-layer
Contains the PyJWT package. Attached to functions that issue or validate JWT tokens.
bcrypt-layer
Sourced from Klayers — a community-maintained repository of pre-built Lambda layer ARNs. Attached to signup_user and login_user for password hashing.
google-api-layer
Contains the Google API Python client library. Attached to functions that call the Gmail API (fetch_invoices, fetch_latest_invoice, fetch_retail_invoices, gmail_store_tokens).
gemini-parsers-layer
Contains Google Gemini client libraries and per-category parser classes used by parse_retail_invoice for AI-assisted retail invoice parsing. Parsers are available for: food delivery, clothing, technology, subscriptions, grocery, utility, miscellaneous, and travel sub-types.
Deployment methods
Zip upload to S3
Most functions are packaged as ZIP archives and stored in the Lambda functions S3 bucket. Terraform reads the object version from S3 and updates the Lambda function when a new version is uploaded.- Update the source code.
- Rebuild the ZIP and upload it to the Lambda functions S3 bucket.
- Run
terraform apply— Terraform detects the new S3 object version and updates the function.
Docker image to ECR (parse_invoice only)
parse_invoice uses a Docker image published to Amazon ECR. This is because its PDF parsing dependency (HyresaviParser) and its transitive requirements exceed the 250 MB unzipped Lambda limit.
parse_invoice:
- Build a new Docker image from
lambdas/invoices/parse_invoice/Dockerfile. - Tag and push to ECR.
- Update
image_uriinlambda_parse_invoice.tfwith the new tag. - Run
terraform apply.