Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

benzene-aws

Host Benzene Python handlers on AWS Lambda — one function, several event sources (API Gateway, SQS, SNS, S3, EventBridge, DynamoDB Streams, Kinesis Data Streams, Kafka/MSK, direct Lambda invoke) — plus SNS/SQS/EventBridge/Kinesis/Lambda outbound clients. The same handlers, no rewrite. Depends on benzene-core and benzene-http.

pip install benzene-aws            # add [boto3] for the real outbound clients
from benzene.aws import AwsLambdaApp, to_lambda_handler

app = AwsLambdaApp(http_router=router, registry=registry)
handler = to_lambda_handler(app)  # your Lambda entry point: handler(event, context)
  • API Gateway — HTTP-like; route → topic, Benzene status → HTTP code.
  • SQS — one scope per record; failures reported via the SQS partial-batch-response (batchItemFailures) so only failed records redeliver.
  • SNS — one scope per record; a failure raises so Lambda retries.
  • S3 (object-created) — one scope per record; bucket/key/eventName become the body; topic from an injectable convention (default s3:object-created). No partial-batch channel, so a failure raises.
  • EventBridge — a single event; topic from detail-type, body is the detail. A failure raises.
  • DynamoDB Streams / Kinesis Data Streams — one scope per record; both support partial batches, so failures are reported via batchItemFailures keyed by the record's sequence number. DynamoDB's topic is derived as {tableName}:{eventName} (e.g. orders:INSERT); Kinesis decodes the base64 payload as the body.
  • Kafka / MSK — records grouped by topic-partition; one scope per record; topic from the topic header (else the Kafka topic), headers decoded UTF-8, base64 value as the body. A failure raises.
  • Direct invoke — a bare {"topic", "headers", "body"} Payload, exactly what another Lambda's lambda.invoke(FunctionName=..., Payload=...) sends (see LambdaMessageSender below). Unlike every trigger-delivered source this is synchronous, like API Gateway: the response envelope is returned verbatim as the invoke's response Payload. Any AwsLambdaApp answers it automatically — no extra wiring.
  • Outbound — SnsMessageSender / SqsMessageSender carry the topic + headers as native message attributes; EventBridgeMessageSender / KinesisMessageSender embed the Benzene envelope in the payload (no attribute channel); LambdaMessageSender invokes another Lambda directly (AWS's own Invoke API, no broker) and decodes its response envelope back into a Result (invocation_type="Event" for fire-and-forget). All implement benzene.core.MessageSender over boto3 (optional).

Topic for SQS/SNS/Kafka comes from the reserved topic metadata key; the channel-less sources (S3, EventBridge, DynamoDB, Kinesis) take their topic from a convention configured on the host; a direct invoke's topic is exactly what the caller sent. Test every event source in memory with benzene.aws.testing — see the runnable examples/aws_orders. Mirrors .NET's Benzene.Aws.Lambda.* / Benzene.Clients.Aws.*, and contributes the benzene.aws subpackage to the shared benzene namespace.

Metadata

Release files for benzene-aws 0.1.0b2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for benzene-aws 0.1.0b2
File Size Uploaded Provenance Actions
benzene_aws-0.1.0b2.tar.gz 22.6 kB With provenance Details for benzene_aws-0.1.0b2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for benzene-aws 0.1.0b2
File Interpreter ABI Platform Actions
benzene_aws-0.1.0b2-py3-none-any.whl Python 3 none any Details for benzene_aws-0.1.0b2-py3-none-any.whl

Total release size: 50.0 kB

Release files / benzene_aws-0.1.0b2.tar.gz

Download URL benzene_aws-0.1.0b2.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ce5fb762217916c8e6af0c30bdc4891501fc1a211d55b5f1826b36cee90c1f7d
BLAKE2b-256 checksum
How to use checksums
e7d107929112dd3ccb49457c852d3686b6b81adaf64e8c23f7e7a6cb2e2f6eb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / benzene_aws-0.1.0b2-py3-none-any.whl

Download URL benzene_aws-0.1.0b2-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09388a499a632c748c8dd2dc1e811aaf3d757944c811c0ee56231e2c9430282f
BLAKE2b-256 checksum
How to use checksums
0f285c7045d01a3a753b85cfca7ed5b7af9bfbfd36749b743fb340ce33b2e59b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Security for benzene-aws 0.1.0b2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for benzene_aws-0.1.0b2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page