pythonamazon-web-servicesaws-lambdaaws-cloudformationaws-lambda-layers

How do i update cfn-response module in CloudFormation stack


I am deploying my Lambda function and getting the below error , I tried to rollback the CloudFromation stack but still getting the same issue .

"CloudFormation did not receive a response from your Custom Resource.If you are using the Python cfn-response module, you may need to update your Lambda function code so that CloudFormation can attach the updated version"

However I have 2 separate environments in Lambda , one is "test" and the other one is "main" where the test Lambda is working fine in updating the stack(maybe it should have latest stack version since created in 2024 ) but when I deploy the same code in "main" lambda I am getting stuck in above error(maybe the stack was created in 2023 ?) .

I do not use cfn-response module anywhere in my code . The only option left is to update the CloudFormation stack but not sure how .


Solution

  • You listed the error in your comment:

    ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module 'aws-sdk'\nRequire stack:\n- /var/task/utils.js\n- /var/task/s3/lib/permissions.js\n- /var/task/s3/handler.js\n- /var/runtime/index.mjs","stack": INIT_REPORT Phase: invoke Status: errorError Type: Runtime.ImportModuleError

    So your lambda in "main" isn't finding the module that the lambda in "test" is finding. My guess is that either

    So eliminate CloudFormation as a variable--it is a symptom, but the root problem is with Lambda. Run a test (from the Lambda console) directly on your non-working lambda function to isolate and troubleshoot.