title: AWS Lambda: failed with error [Errno 13] Permission denied: '/var/task/lambda_function.py
body: <p>I have the following CI/CD setup with Gitlab for deploying my lambda function</p>
  <p><a href="https://i.stack.imgur.com/mbOg1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mbOg1.png" alt="enter image description here" /></a></p>
  <p>When it runs no error happens but when I try executing the function I receive the &quot;failed with error [Errno 13] Permission denied: '/var/task/lambda_function.py&quot; error. Is there any way to solve this? I've found <a href="https://docs.amazonaws.cn/en_us/lambda/latest/dg/troubleshooting-deployment.html" rel="nofollow noreferrer">this</a> article in which aws suggests using chmod to give file permissions, but it didn't help.</p>
  <p>BTW: I've ran the same commands locally in my machine and no error happens when running the function</p>
  <p>Thanks in advance for any answer.</p>
  <p>UPDATE: CloudWatch Logs below</p>
  <p><a href="https://i.stack.imgur.com/iBzF1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iBzF1.png" alt="enter image description here" /></a></p>