feat(lambda): store DurableConfig on functions (execution later) (#5007)

* feat(lambda): accept and echo DurableConfig on functions

CreateFunction and UpdateFunctionConfiguration take DurableConfig, PublishVersion snapshots it, and every read echoes it. ExecutionTimeout is required on create, RetentionPeriodInDays defaults to 14, a durable function's Timeout defaults to min(ExecutionTimeout, 900) and its logging to JSON. Update merges the members, and a function created without DurableConfig cannot gain one. KMSKeyArn is validated against its pattern and stored, the key itself is not looked up.

* chore(lambda): trim the DurableConfig tests to one case per rule

* feat(lambda): durable functions log in JSON format only

A durable function rejects LogFormat Text on create and update, and a LoggingConfig without LogFormat reads back as JSON. An empty KMSKeyArn means no key.

* chore(lambda): let the logging helpers own the durable JSON rule

validateLoggingConfig and applyLoggingConfig take the durable flag, so a durable function's default format and the Text rejection live in one place and a LoggingConfig without LogFormat keeps its log levels. applyDurableConfig sets the retention default and merges, and the test uses chainable helpers.

* chore(lambda): say why the durable compat test ignores a failed cleanup
This commit is contained in:
TATSUNO “Taz” Yasuhiro authored and GitHub committed 2026-10-03 14:35:12 -05:00
1 parent 583b2baf7f
commit 823f8751de
8 files changed
+483 -9

No files matched your search

+9 -2
View File
@@ -675,9 +675,9 @@ No extra configuration or `cap_add` is needed because Docker containers have
`CAP_NET_BIND_SERVICE` in their default capability set, so Floci (running as a
non-root user) can bind UDP/53 without any changes to your Compose file.
### VpcConfig, SnapStart and LoggingConfig
### VpcConfig, SnapStart, LoggingConfig and DurableConfig
All three round-trip through `CreateFunction`, `UpdateFunctionConfiguration`,
All four round-trip through `CreateFunction`, `UpdateFunctionConfiguration`,
`GetFunctionConfiguration`, `GetFunction`, `ListFunctions` and `PublishVersion`.
The response shapes are **not** the request shapes, and Floci follows the AWS model
@@ -688,6 +688,7 @@ rather than echoing the request back:
| `VpcConfig` | `VpcConfig` | `VpcConfigResponse` | `VpcId`, resolved from the first subnet via EC2 |
| `SnapStart` | `SnapStart` | `SnapStartResponse` | `OptimizationStatus` — `On` only for a published version with `ApplyOn=PublishedVersions`, `Off` for `$LATEST` |
| `LoggingConfig` | `LoggingConfig` | `LoggingConfig` | — |
| `DurableConfig` | `DurableConfig` | `DurableConfig` | `RetentionPeriodInDays` defaults to 14; omitted for a function created without it |
`SnapStart` and `LoggingConfig` are always present in a response, as on AWS: an
unset function reads back `SnapStart={ApplyOn: None, OptimizationStatus: Off}` and
@@ -699,6 +700,12 @@ is a permanent diff rather than a cosmetic omission.
`LoggingConfig` is replaced wholesale on update, not merged — an update naming only
`LogFormat` resets `LogGroup` to the default.
`DurableConfig` requires `ExecutionTimeout` on create. A durable function created without
a `Timeout` gets `min(ExecutionTimeout, 900)`. It always logs in JSON format, and
`LogFormat: Text` is rejected. On update the members are merged, and a function created
without `DurableConfig` cannot gain one. The durable execution itself (checkpoints, waits,
callbacks) is not emulated yet; the configuration only round-trips.
`LogGroup` is validated against AWS's documented constraint: 1-512 characters matching
`[.\-_/#A-Za-z0-9]+`. `ApplicationLogLevel` and `SystemLogLevel` are accepted with any
`LogFormat` but are only ever stored — and therefore only ever returned — when the