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/
eventNamebecome the body; topic from an injectable convention (defaults3:object-created). No partial-batch channel, so a failure raises. - EventBridge — a single event; topic from
detail-type, body is thedetail. A failure raises. - DynamoDB Streams / Kinesis Data Streams — one scope per record; both support partial batches,
so failures are reported via
batchItemFailureskeyed by the record's sequence number. DynamoDB's topic defaults todynamodb:<eventname>; Kinesis decodes the base64 payload as the body. - Kafka / MSK — records grouped by topic-partition; one scope per record; topic from the
topicheader (else the Kafka topic), headers decoded UTF-8, base64valueas the body. A failure raises. - Direct invoke — a bare
{"topic", "headers", "body"}Payload, exactly what another Lambda'slambda.invoke(FunctionName=..., Payload=...)sends (seeLambdaMessageSenderbelow). Unlike every trigger-delivered source this is synchronous, like API Gateway: the response envelope is returned verbatim as the invoke's response Payload. AnyAwsLambdaAppanswers it automatically — no extra wiring. - Outbound —
SnsMessageSender/SqsMessageSendercarry the topic + headers as native message attributes;EventBridgeMessageSender/KinesisMessageSenderembed the Benzene envelope in the payload (no attribute channel);LambdaMessageSenderinvokes another Lambda directly (AWS's ownInvokeAPI, no broker) and decodes its response envelope back into aResult(invocation_type="Event"for fire-and-forget). All implementbenzene.core.MessageSenderoverboto3(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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27b0b336156860d0d493348576a9e846a6097f2ade3f8a50505ebd759bbfedcb
|
|
| MD5 |
e2b7fa4ccef8196afb2d21e771f1e50d
|
|
| BLAKE2b-256 |
df0b3f456fbcbabb39721136383c0a4c36f0f67650fdb07c83dbb23d696cf6f1
|
Provenance
The following attestation bundles were made for benzene_aws-0.1.0b1.tar.gz:
Publisher:
release.yml on daniellepelley/benzene-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
benzene_aws-0.1.0b1.tar.gz -
Subject digest:
27b0b336156860d0d493348576a9e846a6097f2ade3f8a50505ebd759bbfedcb - Sigstore transparency entry: 2467247522
- Sigstore integration time:
-
Permalink:
daniellepelley/benzene-python@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daniellepelley
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Trigger Event:
workflow_dispatch
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df505cece5173b4f9c852fb68a026d7e292c0697ab1d312e85668be33ea0522b
|
|
| MD5 |
d4d70f96c54aad783723d8d96acf46e7
|
|
| BLAKE2b-256 |
7dcde9a323c519883452ca4d7ab7d3082ef5d6bc780bec7eef01ca288b9794fa
|
Provenance
The following attestation bundles were made for benzene_aws-0.1.0b1-py3-none-any.whl:
Publisher:
release.yml on daniellepelley/benzene-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
benzene_aws-0.1.0b1-py3-none-any.whl -
Subject digest:
df505cece5173b4f9c852fb68a026d7e292c0697ab1d312e85668be33ea0522b - Sigstore transparency entry: 2467122937
- Sigstore integration time:
-
Permalink:
daniellepelley/benzene-python@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daniellepelley
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7f3c0d2abeeb3782a82a8e2621ee8b431bf02ca8 -
Trigger Event:
workflow_dispatch
-
Statement type: