[backport camel-4.18.x] CAMEL-24354: camel-aws2-lambda - updateFunction never sets the code source - #25353
Merged
Merged
Conversation
… so UpdateFunctionCode no longer fails Lambda2Producer.updateFunction() built an UpdateFunctionCodeRequest that only ever carried functionName and (optionally) publish: it validated that a body, S3 bucket, or S3 key was present and then discarded them, never setting zipFile/s3Bucket/s3Key/s3ObjectVersion. AWS UpdateFunctionCode requires a code source, so every call failed with InvalidParameterValueException and the operation was unusable in the default (non-pojoRequest) mode. Assemble the code source on the request builder from the same headers/body as createFunction (S3 bucket/key/object-version, the ZIP_FILE header path, and the message body), and add a test asserting the request carries it. Also corrects deleteEventSourceMapping's validation message, which read "Event Source Arn must be specified" although it validates the event source mapping UUID. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
davsclaus
approved these changes
Aug 5, 2026
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.
Backport of #25343 to camel-4.18.x.
Lambda2Producer.updateFunction()validated that a body / S3 bucket / S3 key was present, then discarded them and built anUpdateFunctionCodeRequestwith onlyfunctionName(+ optionalpublish). AWSUpdateFunctionCoderequires a code source, so every call failed and the operation was unusable in the default (non-pojoRequest) mode. Now the code source (S3 bucket/key/object-version, ZIP_FILE header path, message body) is assembled on the request, mirroringcreateFunction. Also fixes the misleadingdeleteEventSourceMappingvalidation message (said "Arn" but validates the UUID).Adds
LambdaProducerTest.lambdaUpdateFunctionTest; fullLambdaProducerTestgreen (32 tests) on this branch.🤖 Generated with Claude Code