Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AWS by (19.1k points)

Is it possible to access the local filesystem in an AWS lambda function? If so, is there any downside to doing so?

1 Answer

0 votes
by (44.3k points)

It can be done. You can use this Python function:

localFilename = '/tmp/{}'.format(os.path.basename(key))

s3.download_file(Bucket=bucket, Key=key, Filename=localFilename)

inFile = open(localFilename, "r")

You can use this for the temporary storage and directory /tmp, not to maintain any state.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...