fix(lambda): honour Publish on CreateFunction and UpdateFunctionCode (#2825)

The Publish flag was never read on either path, so no version was ever
created unless the caller made a separate PublishVersion call, and both
actions reported Version as $LATEST. Terraform reads Version and
qualified_arn straight from that response, so every aws_lambda_function
with publish = true recorded $LATEST — which Lambda@Edge cannot use.

Both actions now publish and report the new version. The ARN they return
differs, following the live service rather than the reference, which does
not distinguish them: CreateFunction keeps the unqualified FunctionArn
while UpdateFunctionCode returns the qualified one, as PublishVersion
does.

Closes #2820
This commit is contained in:
Brian Taylor authored and GitHub committed 2026-08-31 14:52:19 -04:00
1 parent 3aaf74520e
commit a7b2b79492
5 files changed
+304 -1

No files matched your search

+7
View File
@@ -166,6 +166,13 @@ services:
Function URLs are also reachable directly on `/{proxy:.*}` under the Lambda URL controller, which routes the request into the normal `Invoke` path.
**Versions:** `CreateFunction` and `UpdateFunctionCode` honour `Publish`, publishing a version
and reporting it in the response's `Version`. The two differ in the ARN they return, matching the
live service: `CreateFunction` keeps the unqualified `FunctionArn` while `UpdateFunctionCode`
returns the qualified one (`...:function:name:2`), as `PublishVersion` does. Without `Publish`
both answer for `$LATEST` and create nothing. `UpdateFunctionConfiguration` has no `Publish`
parameter in the AWS API and none here.
**Layers:** `PublishLayerVersion`, `GetLayerVersion`, `GetLayerVersionByArn`, `ListLayerVersions`,
`ListLayers`, and `DeleteLayerVersion` are implemented, with real local storage under
`{lambda.codePath}/layers/{name}/{version}`. `CreateFunction`/`UpdateFunctionConfiguration`