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.
AWS: How to write to the local file system with 'sam local'?
2k Views Asked by marting At
2
There are 2 best solutions below
1
Alberto Ureña
On
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.
Related Questions in AWS-LAMBDA
- Query parameter works fine with fastapi application when tested locally but not working when the FastAPI application is deployed on AWS lambda
- Lambda endpoint for the Google OAuth callback does not recieve the access_token
- Golang lambda upload image into s3 static website
- Unable to run Bash Script using AWS Custom Lambda Runtime
- Call an External API from AWS Lambda
- AWS Lambda Trigger For Same S3 File Name In Quick Succession
- Trouble Extracting Request Body in Flask-Lambda Application Deployed on AWS Lambda via AWS SAM
- S3 pre-signed url not working on whatsapp cloud Api
- 'Load failed' error when trying to create a function in AWS lambda
- Using Python CDK to bundle dotnet 8 code to AWS Lambda function
- AWS WebSocket API return forbidden (403) error when sending message
- Pass integer value in json serializable Python Object
- AWS Lambda successfully called with 'Function URL', but not with 'API Gateway'
- How do I create a *clean* AWS lambda function in python?
- Laravel Vapor Queue Dynamic DB Connection Issue for Different Requests
Related Questions in SERVERLESS
- Can I spawn a python process in a remote machine as a way to scale my compute?
- Trigger a Cloud Build to only re-deploy GCP Cloud functions that were updated within the same repo
- Import module error when Lambda is deployed - Node
- Scaling Nuclio With KEDA Based on Queue Length: Error ScaledObject Name is Not Specified
- Validation error ApiGatewayMethodProxyVarGet: expected type: Boolean, found: JSONObject in AWS CloudFormation
- AWS API Gateway with proxy-integration by serverless.yml
- Connecting to MongoDB while utilizing the connection within AWS Lambda functions
- Next 14 Error: The "target" property is no longer supported in next.config.js
- Creating an AWS serverless lambda project in Golang
- cloud function update oracle onprem db for large volume of data
- Dockerized Node API with Serverless Framework doesn't work
- How to set Cognito user pool sign-in options in Serverless?
- Got this error in aws -{"error":{"root_cause":[{"type":"authorization_exception","reason":"User does not have permissions for the requested resource"}
- How to create public S3 bucket in Serverless
- How to run step function workflow after lambda is called?
Related Questions in SAM
- How to reference existing lambda in sam template
- aws:userid for the IAM principal used by a Gitlab runner
- programming and debugging of different sam types
- Use ${ServerlessHttpApi} in AWS SecretManager SecretString
- Create Dynamo db stream and trigger to trigger lambda using sam
- Lambda for sending emails based on time
- How can I cut off circular dependency in api gateway and lambda in SAM template?
- AWS SAM en Open API
- AWS SAM local with AppConfig local development mode
- I can't use leafmap in pycharm to display an interactive map
- cloudformation template build fails when trying to pass the ARN of another resource
- SAM - Disable authorizer for one event
- Role Exception when a Step Function invokes a function embedded in a deployed SAM application
- AWS SAM Environment variable
- "Unable to import module 'app': No module named 'rpt_folder'"
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
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