Reputation: 175
I need to read a file in my lambda via sftp and save it locally for processing. The issue is that when running 'sam local' my lambda can only read from the local file system but not write to it.
Upvotes: 2
Views: 2472
Reputation: 29
In AWS Lambda, you have a read-only file system except for the /tmp directory, which allows read-write access.
Any files written to the /tmp directory in AWS Lambda are ephemeral and will be lost after the Lambda function execution context is destroyed (which may happen after a few invocations). If you need to persist these files, consider uploading them to an AWS service like S3.
Upvotes: 0
Reputation: 9442
Lambda functions can only write to a specific local area: /tmp
So that is the location you need to use if you want to write to a file.
See
Upvotes: 2