Trying to update the AWS Lambda code with AWS Cloud Control API always fails.

0

When trying to update the lambda inline code I get the following error:

ValidationException: [REPLACE Operation] noSuchPath in source, path provided: //Code/ZipFile

If I try to update the S3ObjectVersion of the lambda code I get the following error:

ValidationException: [REPLACE Operation] noSuchPath in source, path provided: //Code/S3ObjectVersion

Why isn't it possible to update the lambda code like with AWS Cloud Formation?

Weirdly, when trying to change the Description of a lambda, it gives an error that the Code key is required.

ValidationException: Model validation failed (#: required key [Code] not found)

2개 답변
0
수락된 답변

The reason was that Cloud Control API apparently has write-only properties. All write-only properties need to be included in every update. For some reason, I can't find any documentation about this. But you can find out what properties are write-only by fetching the resource after creation and diffing the properties that aren't present.

답변함 한 달 전
profile picture
전문가
검토됨 한 달 전
0

The errors indicate that Lambda is unable to find the code referenced in the function configuration.

  • The code may have been removed from the S3 location or code repository referenced in the function configuration. Lambda needs the code to be present at the specified location in order to update it.
  • The IAM role used by the function may not have the necessary permissions to access the code source. This could happen if the role policy was changed.
  • There may be a mismatch between the code location referenced in the function versus what is configured in the deployment package.

Try the following:

  • Check that the code is still present in S3 or the code repository
  • Verify the IAM role policy grants access to the code source
  • Use the Lambda console code editor to update the code directly instead of a separate deployment process
  • Delete and recreate the function if the code location cannot be corrected
  • When updating the description, Lambda still requires the Code property to be set even if not changing code. This is expected behavior.
profile picture
전문가
답변함 2달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠