Files
floci/src/main/java
Hector Ventura 3960b6e20e fix(lambda): inject log group/stream and Floci endpoint env vars into Lambda containers (#640)
* fix(lambda): inject log, endpoint, and hostname env vars into Lambda containers

Three missing environment variables prevented Lambda functions from running
correctly with newer runtimes and from reaching back into Floci:

and AWS_LAMBDA_LOG_STREAM_NAME to be set before the runtime initialises. Floci
computed both values but only used them for log streaming — they were never added
to the container's env list, causing a hard PlatformError on boot.

their container. FLOCI_HOSTNAME, FLOCI_ENDPOINT, and AWS_ENDPOINT_URL are now
injected so any AWS SDK client instantiated inside the function uses Floci
automatically, without requiring code changes.

When the embedded DNS server is active (Floci running in Docker), FLOCI_HOSTNAME
is set to the configured hostname (e.g. "floci") rather than a raw IP, because
the DNS server is already wired into each Lambda container as its resolver and
will resolve that name correctly. In local dev mode (no embedded DNS), the
Docker-reachable host address is used as a fallback.

Closes #628
Closes #629

* feat(lambda): implement PutFunctionEventInvokeConfig and sibling endpoints (#632)

Adds the five event-invoke-config REST endpoints that Terraform's aws_lambda_function_event_invoke_config resource requires:

- PUT /2019-09-25/functions/{name}/event-invoke-config — replaces config
- POST — partial update (merge)
- GET — retrieve config, 404 if absent
- DELETE — remove config, 404 if absent
- GET .../event-invoke-config/list — list all qualifiers

New files: FunctionEventInvokeConfig model (with @RegisterForReflection and correct AWS JSON field names), LambdaEventInvokeController, and LambdaEventInvokeConfigTest (10
unit tests). Storage is an in-memory ConcurrentHashMap keyed by region:functionArn:qualifier.

Also fixes the ContainerLauncherTest and LambdaImageConfigTest setUp methods that were missing config.baseUrl() stubs required by the FLOCI_HOSTNAME/FLOCI_ENDPOINT env-var
injection added in the branch.
2026-04-29 00:02:07 -05:00
..