ZIPs created on mac don't work when uploaded to AWS Lambda
Some problems occur when deploying Lambda functions with ZIP files created on mac using the PowerShell scripts.
The first error that occurred:
An error occurred (InvalidParameterValueException) when calling the UpdateFunctionConfiguration operation: Layer conversion failed: Some files do not have read permissions;
Failed setting the Lambda layers of Lambda function Question-YesMaybeNo. Exiting Set-AWSLambdaFunctionLayers
More on that from AWS: https://aws.amazon.com/ru/premiumsupport/knowledge-center/lambda-deployment-package-errors
I have also tried using chmod to change the permissions of both the files in the ZIP folder and the ZIP itself to 755 (or did I try 644?), which however resulted in:
"errorType": "Error",
"errorMessage": "EACCES: permission denied, open '/var/task/CreateCSAConfiguration.js'",
"code": "EACCES",
"errno": -13,
"syscall": "open",
"path": "/var/task/CreateCSAConfiguration.js",
"stack": [
"Error: EACCES: permission denied, open '/var/task/CreateCSAConfiguration.js'",
" at Object.openSync (fs.js:462:3)",
" at Object.readFileSync (fs.js:364:35)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1025:18)",
" at Module.load (internal/modules/cjs/loader.js:863:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
" at Module.require (internal/modules/cjs/loader.js:887:19)",
" at require (internal/modules/cjs/helpers.js:74:18)",
" at _tryRequire (/var/runtime/UserFunction.js:75:12)",
" at _loadUserApp (/var/runtime/UserFunction.js:95:12)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)"
]