5
votes

I create a lambda lambda for Python runtime (3.6 and 3.7 compatible) that contains a bin executable (texlive)

But when I try to execute it through subprocess.run it says that it has no execution permissions!

How can I make it so this layer has execute permissions? I zipped the layer files on Windows 10 so I'm not sure how to add Linux execute permission.

Also, as far as I know when you unzip a file it "resets" the permissions, so if AWS is not setting the execute permissions when unzipping my layers, what can I do?

By the way, I'm uploading my layer via the aws console

1
what is the layer zip folder structure? - Repakula Srushith
I tried /, /bin and /lib, it doesn't make a difference, it seems to inherit the permissions inside the zip - Mojimi
the layers are actually available in the /opt folder. You can find more about it in this blog post: medium.com/@adhorn/… - Repakula Srushith
@RepakulaSrushith I know that, it's not related to the issue. - Mojimi

1 Answers

0
votes

I installed the WSL on Windows 10 and zipped up my layer using the zip executable from within Ubuntu:

zip -r importtime_wrapper_layer.zip .

It created a zip file that retained the 755 file permissions on my script.

I was able to view that the correct attributes were present using 7zip and the Lambda runtime was able to execute it.