The error message you shared is talking about the module named
index this is unlikely to be related to the layer you are specifying. The Handler you have specified is
index.lambda_handlercan you double check that the code you have put in thatr S3 location does indeed have an
index.py in the root of the zip file? You would get that error message if either this file does not exist in that zip OR the zip file does not contain index.py at it's root.
I think that the issue come from the fact that you don't specifcy "Handler" in your CFN def.
Doc at https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-handler says that it is required to specify handler when deploy from a zip.
Handler: the name of the method within your code that Lambda calls to run your
function. Handler is required if the deployment package is a .zip file archive. The
format includes the file name. It can also include namespaces and other qualifiers,
depending on the runtime
- Accepted Answerasked 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 5 days ago
- AWS OFFICIALUpdated 7 days ago
- EXPERTpublished a year ago