Repository navigation
feat(#1613, #1660): Lambda versions, aliases and GetFunctionConfiguration - #1702
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
scttfrdmn
force-pushed
the
feat/v0134-lambda
branch
from
November 25, 2026 00:12
2f63254 to
6c82232
Compare
scttfrdmn
force-pushed
the
feat/v0134-lambda
branch
2 times, most recently
from
November 25, 2026 00:54
7b15fcf to
b7b18da
Compare
…tion PublishVersion snapshots $LATEST as an immutable numbered version; aliases with weighted routing drawn from the request's ID mint; Qualifier resolution in GetFunction, Invoke, the permission operations and DeleteFunction, with another account's ARN refused and the Qualifier parameter authorized against the qualified ARN; GetFunctionConfiguration; Publish=true honoured; AWS::Lambda::Version and AWS::Lambda::Alias CloudFormation rows; qualifiers passed through SNS, S3, API Gateway, ESM and Step Functions invokes; LastUpdateStatus: Successful. Co-Authored-By: Claude <[email protected]>
scttfrdmn
force-pushed
the
feat/v0134-lambda
branch
from
November 25, 2026 01:02
b7b18da to
a69d743
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #1613: the Lambda workstream (versions, aliases,
GetFunctionConfiguration, qualified ARNs). Still open in #1613: reserved and provisioned concurrency and function URLs (filed as a v0.137.0 follow-up), and the other services' workstreams.Part of #1660: item 2 (
GetFunctionConfiguration) and item 4 (LastUpdateStatus) ship here. Items 1, 3, 5 and 6 (ESM tags,GetFunctiontag gating,GetResourceslisting ESMs, role-assumability check) remain.$LATESTatfunction_version:{acct}/{region}/{name}/{n}, numbered from a per-function counter that never reuses a number. Each version records a fingerprint of the code and configuration it came from. The fingerprint covers the S3 code location (bucket, key and object version), so moving to another object publishes a new version even when the package has noCodeSha256. A publish whose fingerprint matches the newest version answers that version again. A staleRevisionIdisPreconditionFailedException/412, using the error's published description. A staleCodeSha256isInvalidParameterValueExceptionwith substrate's own message.Publish: trueonCreateFunctionandUpdateFunctionCodeis honoured.UpdateFunctionConfigurationchanges$LATESTonly.$LATEST, then the versions in numeric order. Pages through v0.133'spage[T]viajsonNextToken;MaxItemsmust be 1–10000, responses are capped at the published 50, and the token is bound to the function.FunctionVersion; a weight from 0 to 1; no weighted alias on$LATEST; the same execution role on both versions; published versions only.DeleteAliason a missing alias answers 204, because its page publishes no not-found error.IDMint, read as a fraction of 2^32, are compared with the weight. Replay therefore routes each invocation to the version it ran on. Seedocs/reference/lambda.md#versions-and-aliases.Qualifieror a qualifiedFunctionNameworks onGetFunction,GetFunctionConfiguration,Invoke(X-Amz-Executed-Versionreports the version that ran), the three permission operations andDeleteFunction. Versions and aliases each have their own resource policy.PublishVersion,ListVersionsByFunctionand the alias operations refuse a qualifiedFunctionNamewithInvalidParameterValueException.lambdaCheckFunctionScoperefuses a function outside the caller's account and Region:AccessDeniedException/403. It uses the "no resource-based policy allows" sentence already recorded for layers (Lambda: cross-account public layer semantics (ListLayerVersions denied, GetLayerVersion AccessDenied for unpublished) #1272).ResourceNotFoundException/404, "Functions from '' are not reachable in this region ('')".TagResource/UntagResource/ListTags,CreateEventSourceMappingandUpdateEventSourceMapping(which now honoursFunctionName, re-pointing the mapping), and EventBridge Scheduler'sCreateSchedule/UpdateSchedulefor templated andaws-sdk:lambda:invoketargets.Qualifierparameter is authorized against the qualified ARN only for the operations that act on the version or alias it names: GetFunction, GetFunctionConfiguration, Invoke, DeleteFunction, AddPermission, RemovePermission and GetPolicy. On those, a Deny onfunction:fn:prodrefuses both?Qualifier=prodandfn:prod. Every other operation is authorized against the function, so?Qualifier=xcannot step around a Deny on UpdateFunctionCode, UpdateFunctionConfiguration, PutFunctionEventInvokeConfig or GetFunctionCodeSigningConfig.Qualifier. Lambda therefore resolves the function the ARN names, or refuses one in another account, instead of invoking a same-named local function or a function named after the alias.s3ARNLastComponentis removed. EventBridge (feat(#1613, #1640): EventBridge buses, per-bus rules, enable/disable, tagging provider #1701) has no Lambda dispatch path, so nothing there changes.Qualifier, it deletes all versions, aliases, their policies and the counter. With one, it deletes a single version: a version an alias references isResourceConflictException/409, and an alias name or$LATESTisInvalidParameterValueException.AWS::Lambda::Version: Ref is the version ARN; GetAttVersionandFunctionArn.AWS::Lambda::Alias: Ref andAliasArnare the alias ARN; the alias updates in place.Routed operations rise from 1,184 to 1,191:
GetFunctionConfiguration,PublishVersionand the five alias operations. Lambda now routes 38. The branch is rebased on c3382f0, with the wire model, catalog anddocs/services.mdregenerated.Provenance
AWS::Lambda::Versionfailure text, "A version for this Lambda function exists ( N ). Modify the function to create a new version.", is observed CloudFormation behaviour. No AWS page publishes it; it is quoted in (aws-lambda): Deploying updated stack with unchanged Lambda and modified execution role fails with error: "A version for this Lambda function exists ( {n} ). Modify the function to create a new version" aws/aws-cdk#14428 and "A version for this Lambda function exists ( 8 ). Modify the function to create a new version.." even when functions have changed serverless/serverless#8392.AccessDeniedExceptionsentence is the observed form already recorded for layers (Lambda: cross-account public layer semantics (ListLayerVersions denied, GetLayerVersion AccessDenied for unpublished) #1272).ResourceNotFoundException, notInvalidParameterValueException, so that is the code used here.Gates run locally
make lint test e2edocs-versions docs-counts-checkSUBSTRATE_IAC=1 make iac-e2e: the CDK and Terraform journeys both pass, run and replay, on a69d743docs/node_modulesremovedTerraform scratch check (first revision; built binary, provider 6.73.0)
The config was
aws_lambda_functionwithpublish = true,aws_lambda_aliason itsversion, andaws_lambda_permissionwithqualifier.applycreated version 1 and the alias.planwas empty.planwas empty.destroywas clean, and the function then answered 404.Follow-ups
PutFunctionEventInvokeConfig'sQualifier, because substrate keeps one event-invoke configuration per function.