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 defaults to dynamodb:<eventname>; 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.
  • OutboundSnsMessageSender / 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

benzene_aws-0.1.0b1.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

benzene_aws-0.1.0b1-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file benzene_aws-0.1.0b1.tar.gz.

File metadata

  • Download URL: benzene_aws-0.1.0b1.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for benzene_aws-0.1.0b1.tar.gz
Algorithm Hash digest
SHA256 27b0b336156860d0d493348576a9e846a6097f2ade3f8a50505ebd759bbfedcb
MD5 e2b7fa4ccef8196afb2d21e771f1e50d
BLAKE2b-256 df0b3f456fbcbabb39721136383c0a4c36f0f67650fdb07c83dbb23d696cf6f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for benzene_aws-0.1.0b1.tar.gz:

Publisher: release.yml on daniellepelley/benzene-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file benzene_aws-0.1.0b1-py3-none-any.whl.

File metadata

  • Download URL: benzene_aws-0.1.0b1-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for benzene_aws-0.1.0b1-py3-none-any.whl
Algorithm Hash digest
SHA256 df505cece5173b4f9c852fb68a026d7e292c0697ab1d312e85668be33ea0522b
MD5 d4d70f96c54aad783723d8d96acf46e7
BLAKE2b-256 7dcde9a323c519883452ca4d7ab7d3082ef5d6bc780bec7eef01ca288b9794fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for benzene_aws-0.1.0b1-py3-none-any.whl:

Publisher: release.yml on daniellepelley/benzene-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0b1 This release

2 files

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