local/

directory
v6.2.0-rc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: Apache-2.0

README

Local example harness

The checked-in local profile and harness behind make examples-local.

  • docker-compose.yml — the local profile: DynamoDB Local plus digest-pinned moto (KMS + STS), s3proxy (S3) and ElasticMQ (SQS) services. Every service publishes an ephemeral loopback port; the harness reads the assigned port back and gives each run a unique compose project name.
  • examples-local.json — the classification manifest. Every example entrypoint in the tree must appear here as L1/L2/L3/I or as pending: <milestone>, every row must name a file that exists in the tree, and every L3/I row carries the named gap the summary prints.
  • run_examples_local.py — discovery, profile startup, preflight, runners, the summary and --cleanup.
  • lambda_runtime.py — builds each handler with its real toolchain, starts it in the official Lambda runtime image (RIE), joins it to the run's network with a closed DNS server, and invokes it over the RIE HTTP API. No handler is called in process.
  • test_examples_local.py — mutation self-tests proving discovery, manifest validation and profile isolation fail closed, including a real two-instance concurrency test (make examples-local-selftest, run by make examples-local first).
  • cmd/examples-local-preflight — proves the harness environment resolves DynamoDB, KMS, STS, S3 and SQS to the profile, sees only the static dummy credentials, and that each backend speaks its AWS protocol.
  • cmd/examples-local-lambda-preflight — runs inside the Lambda runtime image and proves the same endpoints, credentials and backend protocols from the function container, and that a real AWS hostname does not resolve.
  • cmd/examples-local-payment-fixtures — provisions the payment and Lambda tables, seeds the merchant and user rows, publishes the reconciliation CSV to s3proxy, and reads stored state back for assertions.
  • cmd/examples-local-stream-event — performs a real local write, reads the stored item back, and prints a DynamoDB stream record generated from it.
  • cmd/examples-local-kms-key — creates the per-run envelope key and proves the local KMS wraps and unwraps a data key with the framework's context.

Usage: make examples-local, or make examples-local-down to remove leftover profile containers and networks from any run.

The full description, the emulator decision table, class definitions and manifest rules live in docs/examples/local-harness.md.

Directories

Path Synopsis
cmd
examples-local-cdk-fixtures command
Command examples-local-cdk-fixtures prepares and inspects the local state the cdk-multilang rows need: it provisions the shared demo table, the TTL evidence table and the archive bucket, reads an encrypted item back in its raw DynamoDB envelope form, generates a DynamoDB stream REMOVE record from a real local write and delete, and reads the archive object the deployed archive handler wrote to the local S3 emulator.
Command examples-local-cdk-fixtures prepares and inspects the local state the cdk-multilang rows need: it provisions the shared demo table, the TTL evidence table and the archive bucket, reads an encrypted item back in its raw DynamoDB envelope form, generates a DynamoDB stream REMOVE record from a real local write and delete, and reads the archive object the deployed archive handler wrote to the local S3 emulator.
examples-local-kms-key command
Command examples-local-kms-key provisions the KMS key the encryption examples use and proves the local KMS can wrap and unwrap a data key with the same EncryptionContext the framework's v2 envelope sends.
Command examples-local-kms-key provisions the KMS key the encryption examples use and proves the local KMS can wrap and unwrap a data key with the same EncryptionContext the framework's v2 envelope sends.
examples-local-lambda-preflight command
Command examples-local-lambda-preflight runs inside the Lambda runtime container before any example handler and proves the function environment cannot reach real AWS: every SDK endpoint resolves to the local profile's service, only the harness dummy credentials are available, each backend speaks its AWS protocol, and a real AWS hostname does not resolve.
Command examples-local-lambda-preflight runs inside the Lambda runtime container before any example handler and proves the function environment cannot reach real AWS: every SDK endpoint resolves to the local profile's service, only the harness dummy credentials are available, each backend speaks its AWS protocol, and a real AWS hostname does not resolve.
examples-local-payment-fixtures command
Command examples-local-payment-fixtures provisions the local DynamoDB tables the Lambda and payment examples use, seeds fixture rows through the real TableTheory models, publishes a reconciliation object to the local S3 emulator, and reads the stored state back for harness assertions.
Command examples-local-payment-fixtures provisions the local DynamoDB tables the Lambda and payment examples use, seeds fixture rows through the real TableTheory models, publishes a reconciliation object to the local S3 emulator, and reads the stored state back for harness assertions.
examples-local-preflight command
Command examples-local-preflight proves the environment the example harness hands to every child process resolves DynamoDB, KMS, STS, S3 and SQS to the checked-in local profile instead of the real AWS endpoints, that the SDK sees nothing but the harness's static dummy credentials, and that each local backend speaks its real AWS protocol.
Command examples-local-preflight proves the environment the example harness hands to every child process resolves DynamoDB, KMS, STS, S3 and SQS to the checked-in local profile instead of the real AWS endpoints, that the SDK sees nothing but the harness's static dummy credentials, and that each local backend speaks its real AWS protocol.
examples-local-stream-event command
Command examples-local-stream-event performs one real DynamoDB write through TableTheory, reads the stored item back with GetItem, and prints a DynamoDB stream record built from that stored image.
Command examples-local-stream-event performs one real DynamoDB write through TableTheory, reads the stored item back with GetItem, and prints a DynamoDB stream record built from that stored image.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL