- Newest
- Most votes
- Most comments
Hi,
Is your Lambda function trying to write a log file into its file system? If so, according to the AWS documentation, /tmp
is the only valid directory.
It acts as an ephemeral storage area that is preserved just for the lifetime of the execution environment, and it is usually used as a transient cache between invocations, but never as a place to store data permanently.
Hi,
it could be that your Lambda code (or one of its dependencies) has some logic which is writing a file to some temporary folders.
As lambda has only access to the tmp folder as a writable folder, your code or your dependency is not allowed to do so, hence the message.
If this is something you can control directly in your code, you may need to modify it. If it comes from a library, could be that Lambda may not be a fit for that case, unless you use a different library.
Hope it helps ;)
Is it possible to share the Lambda code and the IAM roles and policies attached to the Lambda?
Relevant content
- Accepted Answerasked 9 months ago
- asked 2 years ago
- asked 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 6 months ago
What does your code that's accessing S3 look like? Also, does it run OK on your local machine with the right credentials and permissions set up?
@skinsman It runs fine on the local machine. Also tried it in different environments and works ok. It's a script that does some stuff, followed by moving some files to different folders and writing a log. The problem is not within the code, it's something about the permissions to write inside S3 by Lambda.
Yeah, it seems that the only writable folder is tmp. As I said in the post, the library which I am using is trying to write a log in a folder, which is not tmp and it also needs to move stuff around. So it seems that Lambda it's not such a good approach to my problem. Thank you everyone who answered!